Skip to content

Commit

Permalink
improve: remove cleanup condition (#70)
Browse files Browse the repository at this point in the history
Signed-off-by: Attila Mészáros <csviri@gmail.com>
  • Loading branch information
csviri committed Apr 9, 2024
1 parent 041a88f commit 4aa63b1
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ public class DependentResourceSpec {
@PreserveUnknownFields
private ConditionSpec condition;

@PreserveUnknownFields
private ConditionSpec deletePostCondition;

public String getName() {
return name;
}
Expand Down Expand Up @@ -76,15 +73,6 @@ public DependentResourceSpec setCondition(ConditionSpec conditionSpec) {
return this;
}

public ConditionSpec getDeletePostCondition() {
return deletePostCondition;
}

public DependentResourceSpec setDeletePostCondition(ConditionSpec deletePostConditionSpec) {
this.deletePostCondition = deletePostConditionSpec;
return this;
}

public String getResourceTemplate() {
return resourceTemplate;
}
Expand All @@ -105,13 +93,11 @@ public boolean equals(Object o) {
&& Objects.equals(resourceTemplate, that.resourceTemplate)
&& Objects.equals(resource, that.resource) && Objects.equals(dependsOn, that.dependsOn)
&& Objects.equals(readyPostCondition, that.readyPostCondition)
&& Objects.equals(condition, that.condition)
&& Objects.equals(deletePostCondition, that.deletePostCondition);
&& Objects.equals(condition, that.condition);
}

@Override
public int hashCode() {
return Objects.hash(name, resourceTemplate, resource, dependsOn, readyPostCondition, condition,
deletePostCondition);
return Objects.hash(name, resourceTemplate, resource, dependsOn, readyPostCondition, condition);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,6 @@ private void createAndAddDependentToWorkflow(Glue primary, Context<Glue> context
.ifPresent(c -> builder.withReadyPostcondition(toCondition(c)));
Optional.ofNullable(spec.getCondition())
.ifPresent(c -> builder.withReconcilePrecondition(toCondition(c)));
Optional.ofNullable(spec.getDeletePostCondition())
.ifPresent(c -> builder.withDeletePostcondition(toCondition(c)));
}

private static GenericDependentResource createDependentResource(DependentResourceSpec spec,
Expand Down
1 change: 0 additions & 1 deletion src/test/resources/sample/webpage/webpage.operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ spec:
apiVersion: resourceglueoperator.sample/v1
kind: WebPage
resources:
# todo add to docs that name must be a valid javascript variable name if used in js condition
- name: htmlconfigmap
resource:
apiVersion: v1
Expand Down

0 comments on commit 4aa63b1

Please sign in to comment.