Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/main/java/com/michelin/kafkactl/command/Diff.java
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,12 @@ private List<String> unifiedDiff(Resource live, Resource merged) {
if (live != null) {
live.setStatus(null);
live.getMetadata().setCreationTimestamp(null);
live.getMetadata().setStatus(null);
}

merged.setStatus(null);
merged.getMetadata().setCreationTimestamp(null);
merged.getMetadata().setStatus(null);

DumperOptions options = new DumperOptions();
options.setExplicitStart(true);
Expand All @@ -153,7 +156,6 @@ private List<String> unifiedDiff(Resource live, Resource merged) {
String liveYaml = live != null ? yaml.dump(live) : "";
String mergedYaml = yaml.dump(merged);

// Remove ignored fields
if (!ignoreFields.isEmpty()) {
liveYaml = removeIgnoredFields(liveYaml, ignoreFields, yaml);
mergedYaml = removeIgnoredFields(mergedYaml, ignoreFields, yaml);
Expand Down
44 changes: 44 additions & 0 deletions src/main/java/com/michelin/kafkactl/model/Resource.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/
package com.michelin.kafkactl.model;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.micronaut.core.annotation.ReflectiveAccess;
Expand Down Expand Up @@ -62,5 +63,48 @@ public static class Metadata {

@JsonFormat(shape = JsonFormat.Shape.STRING)
private Date creationTimestamp;

private Status status;

@Getter
@Setter
@Builder
@ReflectiveAccess
@NoArgsConstructor
@AllArgsConstructor
public static class Status {
private Phase phase;
private String message;

@JsonFormat(shape = JsonFormat.Shape.STRING)
private Date lastUpdateTime;
}

public enum Phase {
PENDING("Pending"),
FAIL("Fail"),
SUCCESS("Success");

private final String name;

Phase(String name) {
this.name = name;
}

@Override
public String toString() {
return name;
}

@JsonCreator
public static Phase fromString(String key) {
for (Phase type : Phase.values()) {
if (type.name().equalsIgnoreCase(key)) {
return type;
}
}
return null;
}
}
}
}
Loading