mirror of https://github.com/kubernetes/kops.git
Remap initContainers as well as containers in PodSpec
This commit is contained in:
parent
617ce047e6
commit
12fccd29f9
|
|
@ -47,8 +47,10 @@ func (m *imageRemapVisitor) VisitString(path []string, v string, mutator func(st
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deployments look like spec.template.spec.containers.[2].image
|
// Deployments/DaemonSets/Jobs/StatefulSets have two imapge fields
|
||||||
if n < 3 || path[n-3] != "containers" {
|
// - spec.template.spec.containers.[2].image
|
||||||
|
// - spec.template.spec.initContainers.[2].image
|
||||||
|
if n < 3 || (path[n-3] != "containers" && path[n-3] != "initContainers") {
|
||||||
glog.Warningf("Skipping likely image field: %s", strings.Join(path, "."))
|
glog.Warningf("Skipping likely image field: %s", strings.Join(path, "."))
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue