Skip to content
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.

Commit

Permalink
Chore: Remove enrichAll flag from ImageChangeTriggerEnricher config
Browse files Browse the repository at this point in the history
  • Loading branch information
rohanKanojia committed May 22, 2019
1 parent 8da1173 commit c9285f4
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ After this we will switch probably to real [Semantic Versioning 2.0.0](http://se
* Update Docker Maven Plugin to 0.29.0
* Fix 1632: imagePullPolicy configuration fixed as per documentation
* Fix #1591: Add support for custom resources creation via resource fragments
* Remove enrichAll parameter from ImageChangeTriggerEnricher

### 4.1.0 (16-02-2019)
* Fix 1578: Fmp is generating ImageChange triggers in the DeploymentConfig
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,14 @@ protected Boolean isAutomaticTriggerEnabled(MavenEnricherContext enricherContext
}
}

protected Boolean enrichAllWithImageChangeTrigger(MavenEnricherContext enricherContext, Boolean defaultValue) {
if(enricherContext.getProperty("fabric8.openshift.enrichAllWithImageChangeTrigger") != null) {
return Boolean.parseBoolean(enricherContext.getProperty("fabric8.openshift.enrichAllWithImageChangeTrigger").toString());
} else {
return defaultValue;
}
}

protected Long getOpenshiftDeployTimeoutInSeconds(MavenEnricherContext enricherContext, Long defaultValue) {
if (enricherContext.getProperty("fabric8.openshift.deployTimeoutSeconds") != null) {
return Long.parseLong(enricherContext.getProperty("fabric8.openshift.deployTimeoutSeconds").toString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ public class ImageChangeTriggerEnricher extends BaseEnricher {


private enum Config implements Configs.Key {
containers {{ d = ""; }},
enrichAll {{ d = "false"; }};
containers {{ d = ""; }};

public String def() { return d; } protected String d;
}
Expand Down Expand Up @@ -95,19 +94,19 @@ public void visit(DeploymentConfigSpecBuilder builder) {
.endImageChangeParams()
.endTrigger();
}
if(trimImageInContainerSpecFlag) {
builder.editTemplate().editSpec().withContainers(trimImagesInContainers(template)).endSpec().endTemplate();
}
}

if(trimImageInContainerSpecFlag) {
builder.editTemplate().editSpec().withContainers(trimImagesInContainers(template)).endSpec().endTemplate();
}
}
}
});
}

private Boolean isImageChangeTriggerNeeded(String containerName) {
String containersFromConfig = Configs.asString(getConfig(Config.containers));
Boolean enrichAll = Configs.asBoolean(getConfig(Config.enrichAll));
Boolean enrichAll = enrichAllWithImageChangeTrigger((MavenEnricherContext)enricherContext, false);

if(enrichAll) {
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,9 @@ public class ResourceMojo extends AbstractFabric8Mojo {
@Parameter(property = "fabric8.openshift.imageChangeTrigger", defaultValue = "true")
private Boolean enableImageChangeTrigger;

@Parameter(property = "fabric8.openshift.enrichAllWithImageChangeTrigger", defaultValue = "false")
private Boolean erichAllWithImageChangeTrigger;

@Parameter(property = "docker.skip.resource", defaultValue = "false")
protected boolean skipResource;

Expand Down

0 comments on commit c9285f4

Please sign in to comment.