mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 19:31:44 +00:00
crd create event: skip storage teardown if the crd info doesn't change
This commit is contained in:
parent
d815833a30
commit
ba143a7bdd
@ -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)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user