diff --git a/pkg/registry/core/node/strategy.go b/pkg/registry/core/node/strategy.go index 2e442f2498c..a699f084511 100644 --- a/pkg/registry/core/node/strategy.go +++ b/pkg/registry/core/node/strategy.go @@ -107,7 +107,7 @@ func dropDisabledFields(node *api.Node, oldNode *api.Node) { node.Status.RuntimeHandlers = nil } - if !utilfeature.DefaultFeatureGate.Enabled(features.SupplementalGroupsPolicy) { + if !utilfeature.DefaultFeatureGate.Enabled(features.SupplementalGroupsPolicy) && !supplementalGroupsPolicyInUse(oldNode) { node.Status.Features = nil } } @@ -299,3 +299,11 @@ func fieldIsDeprecatedWarnings(obj runtime.Object) []string { } return warnings } + +// supplementalGroupsPolicyInUse returns true if the node.status has NodeFeature +func supplementalGroupsPolicyInUse(node *api.Node) bool { + if node == nil { + return false + } + return node.Status.Features != nil +}