fix --local panic in set commands

This commit is contained in:
juanvallejo
2018-06-29 10:36:44 -04:00
parent 98de0729cf
commit e8df247597
6 changed files with 25 additions and 7 deletions

View File

@@ -260,14 +260,15 @@ func (o *SetResourcesOptions) Run() error {
for _, patch := range patches {
info := patch.Info
name := info.ObjectName()
if patch.Err != nil {
allErrs = append(allErrs, fmt.Errorf("error: %s/%s %v", info.Mapping.Resource, info.Name, patch.Err))
allErrs = append(allErrs, fmt.Errorf("error: %s %v\n", name, patch.Err))
continue
}
//no changes
if string(patch.Patch) == "{}" || len(patch.Patch) == 0 {
allErrs = append(allErrs, fmt.Errorf("info: %s %q was not changed", info.Mapping.Resource, info.Name))
allErrs = append(allErrs, fmt.Errorf("info: %s was not changed\n", name))
continue
}