Merge pull request #406 from schweikert/fix_issue_335

error out if patchesJson6902 target can't be found, fixes #335
This commit is contained in:
Jeff Regan
2018-10-03 16:32:48 -07:00
committed by GitHub

View File

@@ -18,7 +18,6 @@ package transformer
import (
"fmt"
"log"
"sigs.k8s.io/kustomize/pkg/resmap"
"sigs.k8s.io/kustomize/pkg/resource"
@@ -37,8 +36,7 @@ func findTargetObj(m resmap.ResMap, targetId resource.ResId) (*resource.Resource
}
if len(matchedIds) == 0 {
log.Printf("Couldn't find any object to apply the json patch %v, skipping it.", targetId)
return nil, nil
return nil, fmt.Errorf("couldn't find any object to apply the json patch %v", targetId)
}
if len(matchedIds) > 1 {
return nil, fmt.Errorf("found multiple objects that the patch can apply %v", matchedIds)