mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 22:46:12 +00:00
Merge pull request #130507 from cici37/updateFG
Update OrderedNamespaceDeletion feature gate on by default
This commit is contained in:
commit
76b80b1c15
@ -528,12 +528,10 @@ func (d *namespacedResourcesDeleter) deleteAllContent(ctx context.Context, ns *v
|
||||
gvrToNumRemaining: map[schema.GroupVersionResource]int{},
|
||||
finalizersToNumRemaining: map[string]int{},
|
||||
}
|
||||
podsGVR := schema.GroupVersionResource{Group: "", Version: "v1", Resource: "pods"}
|
||||
|
||||
if utilfeature.DefaultFeatureGate.Enabled(features.OrderedNamespaceDeletion) {
|
||||
// TODO: remove this log when the feature gate is enabled by default
|
||||
logger.V(5).Info("Namespace controller - OrderedNamespaceDeletion feature gate is enabled", "namespace", namespace)
|
||||
if _, hasPods := groupVersionResources[podsGVR]; hasPods && utilfeature.DefaultFeatureGate.Enabled(features.OrderedNamespaceDeletion) {
|
||||
// Ensure all pods in the namespace are deleted first
|
||||
podsGVR := schema.GroupVersionResource{Group: "", Version: "v1", Resource: "pods"}
|
||||
gvrDeletionMetadata, err := d.deleteAllContentForGroupVersionResource(ctx, podsGVR, namespace, namespaceDeletedAt)
|
||||
if err != nil {
|
||||
errs = append(errs, fmt.Errorf("failed to delete pods for namespace: %s, err: %w", namespace, err))
|
||||
@ -561,6 +559,10 @@ func (d *namespacedResourcesDeleter) deleteAllContent(ctx context.Context, ns *v
|
||||
|
||||
// Proceed with deleting other resources in the namespace
|
||||
for gvr := range groupVersionResources {
|
||||
if utilfeature.DefaultFeatureGate.Enabled(features.OrderedNamespaceDeletion) && gvr.Group == podsGVR.Group &&
|
||||
gvr.Version == podsGVR.Version && gvr.Resource == podsGVR.Resource {
|
||||
continue
|
||||
}
|
||||
gvrDeletionMetadata, err := d.deleteAllContentForGroupVersionResource(ctx, gvr, namespace, namespaceDeletedAt)
|
||||
if err != nil {
|
||||
// If there is an error, hold on to it but proceed with all the remaining
|
||||
|
@ -548,7 +548,8 @@ var defaultVersionedKubernetesFeatureGates = map[featuregate.Feature]featuregate
|
||||
},
|
||||
|
||||
OrderedNamespaceDeletion: {
|
||||
{Version: version.MustParse("1.33"), Default: false, PreRelease: featuregate.Alpha},
|
||||
{Version: version.MustParse("1.30"), Default: false, PreRelease: featuregate.Beta},
|
||||
{Version: version.MustParse("1.33"), Default: true, PreRelease: featuregate.Beta},
|
||||
},
|
||||
|
||||
PersistentVolumeLastPhaseTransitionTime: {
|
||||
|
@ -888,7 +888,11 @@
|
||||
versionedSpecs:
|
||||
- default: false
|
||||
lockToDefault: false
|
||||
preRelease: Alpha
|
||||
preRelease: Beta
|
||||
version: "1.30"
|
||||
- default: true
|
||||
lockToDefault: false
|
||||
preRelease: Beta
|
||||
version: "1.33"
|
||||
- name: PersistentVolumeLastPhaseTransitionTime
|
||||
versionedSpecs:
|
||||
|
Loading…
Reference in New Issue
Block a user