Merge pull request #591 from Liujingfang1/msg

improve error message when failing to find an object to patch
This commit is contained in:
Jeff Regan
2018-12-04 13:46:43 -08:00
committed by GitHub

View File

@@ -62,7 +62,7 @@ func (pt *patchTransformer) Transform(baseResourceMap resmap.ResMap) error {
id := patch.Id()
matchedIds := baseResourceMap.FindByGVKN(id)
if len(matchedIds) == 0 {
return fmt.Errorf("failed to find an object with %#v to apply the patch", id.Gvk())
return fmt.Errorf("failed to find an object with %s to apply the patch", id.GvknString())
}
if len(matchedIds) > 1 {
return fmt.Errorf("found multiple objects %#v targeted by patch %#v (ambiguous)", matchedIds, id)