Skip to content

Commit

Permalink
Fix RemoveDeploymentTriggerDecorator order
Browse files Browse the repository at this point in the history
The decorator RemoveDeploymentTriggerDecorator was not configured to be triggered before ChangeDeploymentTriggerDecorator, so sometimes the image stream tag was wrong.

Relates to failures in https://github.com/dekorateio/dekorate/actions/runs/4023231521/jobs/6913879180
  • Loading branch information
Sgitario committed Feb 1, 2023
1 parent 247fcb5 commit ce2d2d6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ public List<DecoratorBuildItem> createDecorators(ApplicationInfoBuildItem applic
String imageStreamWithTag = name + ":" + i.getTag();
result.add(new DecoratorBuildItem(OPENSHIFT, new ApplyContainerImageDecorator(name, imageStreamWithTag)));
// remove the default trigger which has a wrong version
result.add(new DecoratorBuildItem(OPENSHIFT, new RemoveDeploymentTriggerDecorator()));
result.add(new DecoratorBuildItem(OPENSHIFT, new RemoveDeploymentTriggerDecorator(name)));
// re-add the trigger with the correct version
result.add(new DecoratorBuildItem(OPENSHIFT, new ChangeDeploymentTriggerDecorator(name, imageStreamWithTag)));
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,17 @@

public class RemoveDeploymentTriggerDecorator extends NamedResourceDecorator<DeploymentConfigSpecFluent<?>> {

public RemoveDeploymentTriggerDecorator(String name) {
super(name);
}

@Override
public void andThenVisit(DeploymentConfigSpecFluent<?> deploymentConfigSpec, ObjectMeta objectMeta) {
deploymentConfigSpec.withTriggers(Collections.emptyList());
}

@Override
public Class<? extends Decorator>[] after() {
public Class<? extends Decorator>[] before() {
return new Class[] { ApplyDeploymentTriggerDecorator.class };
}
}

0 comments on commit ce2d2d6

Please sign in to comment.