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 committed Mar 6, 2020
1 parent b5ed36f commit d073d19
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ Usage:
./scripts/extract-changelog-for-version.sh 1.3.37 5
```
### 0.2.1-SNAPSHOT
* Port [#1794](https://github.com/fabric8io/fabric8-maven-plugin/pull/1794): 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 d073d19

Please sign in to comment.