This commit is contained in:
Jeffrey Regan
2019-03-26 10:47:31 -07:00
parent 9764eb2f83
commit 267eec5509

View File

@@ -72,7 +72,7 @@ func (pt *imageTransformer) Transform(m resmap.ResMap) error {
*/ */
func (pt *imageTransformer) findAndReplaceImage(obj map[string]interface{}) error { func (pt *imageTransformer) findAndReplaceImage(obj map[string]interface{}) error {
paths := []string{"containers", "initContainers"} paths := []string{"containers", "initContainers"}
found := false updated := false
for _, path := range paths { for _, path := range paths {
containers, found := obj[path] containers, found := obj[path]
if found { if found {
@@ -80,9 +80,10 @@ func (pt *imageTransformer) findAndReplaceImage(obj map[string]interface{}) erro
if err != nil { if err != nil {
return err return err
} }
updated = true
} }
} }
if !found { if !updated {
return pt.findContainers(obj) return pt.findContainers(obj)
} }
return nil return nil