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

Fix ImageChange triggers not being set in DeploymentConfig when resource fragments are used. #1794

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Usage:
* Fix #1789: script to extract changelog information for notifications
* Fix #1770: Fixed my mistake, remove constructors from OpenshiftBuildConfig which were causing PluginConfigurationException
* Fix #1791: Fix NullPointerException in FileDataSecretEnricher (due to recent change in Kubernetes Client Builder null to LinkedHashMap conversion)
* Fix: ImageChangeTags not being applied in DeploymentConfig generated by plugin in case of resource fragments. (Issue found in [this](https://stackoverflow.com/questions/60375063) StackOverflow post.)

### 4.4.0 (2020-02-13)
* Fix #1572: Support maven --batch-mode option
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,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 @@ -753,6 +755,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