Skip to content

Commit 1663223

Browse files
committed
KEP-3619: should check supplementalGroupsPolicyInUse for oldNode in dropDisabledFields for node
1 parent a89bb01 commit 1663223

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

pkg/registry/core/node/strategy.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ func dropDisabledFields(node *api.Node, oldNode *api.Node) {
107107
node.Status.RuntimeHandlers = nil
108108
}
109109

110-
if !utilfeature.DefaultFeatureGate.Enabled(features.SupplementalGroupsPolicy) {
110+
if !utilfeature.DefaultFeatureGate.Enabled(features.SupplementalGroupsPolicy) && !supplementalGroupsPolicyInUse(oldNode) {
111111
node.Status.Features = nil
112112
}
113113
}
@@ -299,3 +299,11 @@ func fieldIsDeprecatedWarnings(obj runtime.Object) []string {
299299
}
300300
return warnings
301301
}
302+
303+
// supplementalGroupsPolicyInUse returns true if the node.status has NodeFeature
304+
func supplementalGroupsPolicyInUse(node *api.Node) bool {
305+
if node == nil {
306+
return false
307+
}
308+
return node.Status.Features != nil
309+
}

0 commit comments

Comments
 (0)