|
|
|
@ -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_kind: %s, new_kind: %s", info.Namespace, info.Name, existing.GetObjectKind().GroupVersionKind(), info.Mapping.GroupVersionKind)
|
|
|
|
|
})
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|