mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-11 17:12:51 +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 (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
|
||||||
|
|
||||||
"sigs.k8s.io/kustomize/pkg/resmap"
|
"sigs.k8s.io/kustomize/pkg/resmap"
|
||||||
"sigs.k8s.io/kustomize/pkg/resource"
|
"sigs.k8s.io/kustomize/pkg/resource"
|
||||||
@@ -37,8 +36,7 @@ func findTargetObj(m resmap.ResMap, targetId resource.ResId) (*resource.Resource
|
|||||||
}
|
}
|
||||||
|
|
||||||
if len(matchedIds) == 0 {
|
if len(matchedIds) == 0 {
|
||||||
log.Printf("Couldn't find any object to apply the json patch %v, skipping it.", targetId)
|
return nil, fmt.Errorf("couldn't find any object to apply the json patch %v", targetId)
|
||||||
return nil, nil
|
|
||||||
}
|
}
|
||||||
if len(matchedIds) > 1 {
|
if len(matchedIds) > 1 {
|
||||||
return nil, fmt.Errorf("found multiple objects that the patch can apply %v", matchedIds)
|
return nil, fmt.Errorf("found multiple objects that the patch can apply %v", matchedIds)
|
||||||
|
|||||||
Reference in New Issue
Block a user