KEP-3619: should check supplementalGroupsPolicyInUse for oldNode in dropDisabledFields for node

This commit is contained in:
Shingo Omura
2024-07-10 15:18:13 +09:00
parent a89bb017a3
commit 1663223e58

View File

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