From 279826f6d6c425d76e3c9e437e5d95e2ca7e8dca Mon Sep 17 00:00:00 2001 From: David Schweikert Date: Wed, 3 Oct 2018 21:53:45 +0200 Subject: [PATCH] error out if patchesJson6902 target can't be found, fixes #335 --- pkg/patch/transformer/util.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkg/patch/transformer/util.go b/pkg/patch/transformer/util.go index 0387c5a19..0e4d9e55a 100644 --- a/pkg/patch/transformer/util.go +++ b/pkg/patch/transformer/util.go @@ -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)