Skip to content

Commit

Permalink
Fix ImageChange triggers not being set in DeploymentConfig when resou…
Browse files Browse the repository at this point in the history
…rce fragments are used.

Ported PR from FMP fabric8io/fabric8-maven-plugin#1794
  • Loading branch information
rohanKanojia authored and manusa committed Mar 9, 2020
1 parent 0d02f1e commit 2a09088
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Usage:
```
### 0.2.1-SNAPSHOT
* Fix #53: Renamed plugins to openshift/kubernetes-maven-plugin keeping acronym (oc/k8s) for goal
* Fix #97: Port of fabric8io/fabric8-maven-plugin#1794 to fix ImageChange triggers not being set in DeploymentConfig when resource fragments are used

### 0.2.0 (05-03-2020)
* Fix #71: script to extract changelog information for notifications
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,8 @@ public static String mergePodSpec(PodSpecBuilder builder, PodSpec defaultPodSpec
}

public static String mergePodSpec(PodSpecBuilder builder, PodSpec defaultPodSpec, String defaultName, boolean sidecarEnabled) {
// The default application container name is needed by plugin in order
// to add ImageChange triggers in case of DeploymentConfig
String defaultApplicationContainerName = null;
List<Container> containers = builder.buildContainers();
List<Container> defaultContainers = defaultPodSpec.getContainers();
Expand Down Expand Up @@ -673,6 +675,11 @@ public static String mergePodSpec(PodSpecBuilder builder, PodSpec defaultPodSpec
container = new Container();
containers.add(container);
}
// If default container name is not set, add first found
// container as default application container.
if (defaultApplicationContainerName == null) {
defaultApplicationContainerName = container.getName();
}
}

mergeSimpleFields(container, defaultContainer);
Expand Down

0 comments on commit 2a09088

Please sign in to comment.