mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 01:06:27 +00:00
Mark the feature gate on by default since it's a security fix.
This commit is contained in:
parent
d496b6c49c
commit
9598e5a1a5
@ -528,12 +528,10 @@ func (d *namespacedResourcesDeleter) deleteAllContent(ctx context.Context, ns *v
|
|||||||
gvrToNumRemaining: map[schema.GroupVersionResource]int{},
|
gvrToNumRemaining: map[schema.GroupVersionResource]int{},
|
||||||
finalizersToNumRemaining: map[string]int{},
|
finalizersToNumRemaining: map[string]int{},
|
||||||
}
|
}
|
||||||
|
podsGVR := schema.GroupVersionResource{Group: "", Version: "v1", Resource: "pods"}
|
||||||
|
|
||||||
if utilfeature.DefaultFeatureGate.Enabled(features.OrderedNamespaceDeletion) {
|
if _, hasPods := groupVersionResources[podsGVR]; hasPods && 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)
|
|
||||||
// Ensure all pods in the namespace are deleted first
|
// 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)
|
gvrDeletionMetadata, err := d.deleteAllContentForGroupVersionResource(ctx, podsGVR, namespace, namespaceDeletedAt)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errs = append(errs, fmt.Errorf("failed to delete pods for namespace: %s, err: %w", namespace, err))
|
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
|
// Proceed with deleting other resources in the namespace
|
||||||
for gvr := range groupVersionResources {
|
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)
|
gvrDeletionMetadata, err := d.deleteAllContentForGroupVersionResource(ctx, gvr, namespace, namespaceDeletedAt)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// If there is an error, hold on to it but proceed with all the remaining
|
// If there is an error, hold on to it but proceed with all the remaining
|
||||||
|
@ -545,7 +545,8 @@ var defaultVersionedKubernetesFeatureGates = map[featuregate.Feature]featuregate
|
|||||||
},
|
},
|
||||||
|
|
||||||
OrderedNamespaceDeletion: {
|
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: {
|
PersistentVolumeLastPhaseTransitionTime: {
|
||||||
|
@ -864,7 +864,11 @@
|
|||||||
versionedSpecs:
|
versionedSpecs:
|
||||||
- default: false
|
- default: false
|
||||||
lockToDefault: false
|
lockToDefault: false
|
||||||
preRelease: Alpha
|
preRelease: Beta
|
||||||
|
version: "1.30"
|
||||||
|
- default: true
|
||||||
|
lockToDefault: false
|
||||||
|
preRelease: Beta
|
||||||
version: "1.33"
|
version: "1.33"
|
||||||
- name: PersistentVolumeLastPhaseTransitionTime
|
- name: PersistentVolumeLastPhaseTransitionTime
|
||||||
versionedSpecs:
|
versionedSpecs:
|
||||||
|
Loading…
Reference in New Issue
Block a user