diff --git a/staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/customresource_handler.go b/staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/customresource_handler.go index 00ddbe71461..99a9481cad7 100644 --- a/staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/customresource_handler.go +++ b/staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/customresource_handler.go @@ -468,6 +468,16 @@ func (r *crdHandler) createCustomResourceDefinition(obj interface{}) { r.customStorageLock.Lock() defer r.customStorageLock.Unlock() // this could happen if the create event is merged from create-update events + storageMap := r.customStorage.Load().(crdStorageMap) + oldInfo, found := storageMap[crd.UID] + if !found { + return + } + if apiequality.Semantic.DeepEqual(&crd.Spec, oldInfo.spec) && apiequality.Semantic.DeepEqual(&crd.Status.AcceptedNames, oldInfo.acceptedNames) { + klog.V(6).Infof("Ignoring customresourcedefinition %s create event because a storage with the same spec and accepted names exists", + crd.Name) + return + } r.removeStorage_locked(crd.UID) }