You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 26, 2023. It is now read-only.
// If the object wasn't and isn't inherited, it's none of our business.
111
+
// If the object wasn't and isn't inherited, we will check to see if the
112
+
// source can be created without causing any conflict.
110
113
if!oldInherited&&!newInherited {
114
+
ifyes, dnses:=o.hasConflict(inst); yes {
115
+
dnsesStr:=strings.Join(dnses, "\n * ")
116
+
msg:=fmt.Sprintf("\nCannot create %q (%s) in namespace %q because it would overwrite objects in the following descendant namespace(s):\n * %s\nTo fix this, choose a different name for the object, or remove the conflicting objects from the above namespaces.", inst.GetName(), inst.GroupVersionKind(), inst.GetNamespace(), dnsesStr)
117
+
returndeny(metav1.StatusReasonConflict, msg)
118
+
}
111
119
returnallow("source object")
112
120
}
113
121
@@ -146,6 +154,33 @@ func (o *Object) handle(ctx context.Context, log logr.Logger, op admissionv1beta
0 commit comments