Merge pull request #130507 from cici37/updateFG

Update OrderedNamespaceDeletion feature gate on by default
This commit is contained in:
Kubernetes Prow Robot 2025-03-04 14:49:52 -08:00 committed by GitHub
commit 76b80b1c15
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 13 additions and 6 deletions

View File

@ -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

View File

@ -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: {

View File

@ -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: