Skip to content

Commit 093f975

Browse files
Merge pull request #18790 from openshift-cherrypick-robot/cherry-pick-18785-to-release-3.9
[release-3.9] Fix initContainer name lookup for ImageChange trigger
2 parents 7df1815 + a7adc66 commit 093f975

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/image/trigger/deploymentconfigs/deploymentconfigs.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func calculateDeploymentConfigTrigger(t appsapi.DeploymentTriggerPolicy, dc *app
6666
})
6767
}
6868
for _, index := range indicesForContainerNames(dc.Spec.Template.Spec.InitContainers, t.ImageChangeParams.ContainerNames) {
69-
fieldPath := fmt.Sprintf("spec.template.spec.initContainers[@name==\"%s\"].image", dc.Spec.Template.Spec.Containers[index].Name)
69+
fieldPath := fmt.Sprintf("spec.template.spec.initContainers[@name==\"%s\"].image", dc.Spec.Template.Spec.InitContainers[index].Name)
7070
triggers = append(triggers, triggerapi.ObjectFieldTrigger{
7171
From: triggerapi.ObjectReference{
7272
Name: from.Name,

0 commit comments

Comments
 (0)