Skip to content

Commit 279826f

Browse files
committed
error out if patchesJson6902 target can't be found, fixes #335
1 parent a1538c5 commit 279826f

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

pkg/patch/transformer/util.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ package transformer
1818

1919
import (
2020
"fmt"
21-
"log"
2221

2322
"sigs.k8s.io/kustomize/pkg/resmap"
2423
"sigs.k8s.io/kustomize/pkg/resource"
@@ -37,8 +36,7 @@ func findTargetObj(m resmap.ResMap, targetId resource.ResId) (*resource.Resource
3736
}
3837

3938
if len(matchedIds) == 0 {
40-
log.Printf("Couldn't find any object to apply the json patch %v, skipping it.", targetId)
41-
return nil, nil
39+
return nil, fmt.Errorf("couldn't find any object to apply the json patch %v", targetId)
4240
}
4341
if len(matchedIds) > 1 {
4442
return nil, fmt.Errorf("found multiple objects that the patch can apply %v", matchedIds)

0 commit comments

Comments
 (0)