Merge pull request #920 from monopole/fix918

fix a bool check
This commit is contained in:
Kubernetes Prow Robot
2019-03-26 11:03:22 -07:00
committed by GitHub

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