Skip to content

Commit a7adc66

Browse files
alexcernopenshift-cherrypick-robot
authored and
openshift-cherrypick-robot
committed
Fix initContainer name lookup for ImageChange trigger
1 parent 1f02cb5 commit a7adc66

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)