diff --git a/pkg/action/validate.go b/pkg/action/validate.go index 526a4c7fc..30a1d1197 100644 --- a/pkg/action/validate.go +++ b/pkg/action/validate.go @@ -33,7 +33,8 @@ func existingResourceConflict(resources kube.ResourceList) error { } helper := resource.NewHelper(info.Client, info.Mapping) - if _, err := helper.Get(info.Namespace, info.Name, info.Export); err != nil { + existing, err := helper.Get(info.Namespace, info.Name, info.Export) + if err != nil { if apierrors.IsNotFound(err) { return nil } @@ -41,7 +42,7 @@ func existingResourceConflict(resources kube.ResourceList) error { return errors.Wrap(err, "could not get information about the resource") } - return fmt.Errorf("existing resource conflict: kind: %s, namespace: %s, name: %s", info.Mapping.GroupVersionKind.Kind, info.Namespace, info.Name) + return fmt.Errorf("existing resource conflict: namespace: %s, name: %s, existing: [gvk: %s, ] / new: [gvk: %s]", info.Namespace, info.Name, existing.GetObjectKind().GroupVersionKind(), info.Mapping.GroupVersionKind) }) return err }