mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-10 08:20:59 +00:00
error out if patchesJson6902 target can't be found, fixes #335
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user