KEP-3619: should check supplementalGroupsPolicyInUse for oldNode in dropDisabledFields for node
This commit is contained in:
		| @@ -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 | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Shingo Omura
					Shingo Omura