improve error message when failing to find an object to patch

This commit is contained in:
Jingfang Liu
2018-12-03 09:30:31 -08:00
parent 8f701a0041
commit a62d15e746

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)