Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix InTreePluginAWSUnregister feature gate removal in 1.31 #16708

Merged
merged 1 commit into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions pkg/model/components/apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,8 @@ func (b *KubeAPIServerOptionsBuilder) BuildOptions(o interface{}) error {

if clusterSpec.CloudProvider.AWS != nil {

if _, found := c.FeatureGates["InTreePluginAWSUnregister"]; !found {
if _, found := c.FeatureGates["InTreePluginAWSUnregister"]; !found && b.IsKubernetesLT("1.31") {
c.FeatureGates["InTreePluginAWSUnregister"] = "true"
} else if b.IsKubernetesGTE("1.31") {
delete(c.FeatureGates, "InTreePluginAWSUnregister")
}

if _, found := c.FeatureGates["CSIMigrationAWS"]; !found && b.IsKubernetesLT("1.27") {
Expand Down
4 changes: 1 addition & 3 deletions pkg/model/components/kubecontrollermanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,8 @@ func (b *KubeControllerManagerOptionsBuilder) BuildOptions(o interface{}) error
kcm.FeatureGates = make(map[string]string)
}

if _, found := kcm.FeatureGates["InTreePluginAWSUnregister"]; !found {
if _, found := kcm.FeatureGates["InTreePluginAWSUnregister"]; !found && b.IsKubernetesLT("1.31") {
kcm.FeatureGates["InTreePluginAWSUnregister"] = "true"
} else if b.IsKubernetesGTE("1.31") {
delete(kcm.FeatureGates, "InTreePluginAWSUnregister")
}

if _, found := kcm.FeatureGates["CSIMigrationAWS"]; !found && b.IsKubernetesLT("1.27") {
Expand Down
10 changes: 4 additions & 6 deletions pkg/model/components/kubelet.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,14 +172,12 @@ func (b *KubeletOptionsBuilder) BuildOptions(o interface{}) error {
}

if clusterSpec.CloudProvider.AWS != nil {
if _, found := clusterSpec.Kubelet.FeatureGates["CSIMigrationAWS"]; !found && b.IsKubernetesLT("1.27") {
clusterSpec.Kubelet.FeatureGates["CSIMigrationAWS"] = "true"
if _, found := clusterSpec.Kubelet.FeatureGates["InTreePluginAWSUnregister"]; !found && b.IsKubernetesLT("1.31") {
clusterSpec.Kubelet.FeatureGates["InTreePluginAWSUnregister"] = "true"
}

if _, found := clusterSpec.Kubelet.FeatureGates["InTreePluginAWSUnregister"]; !found {
clusterSpec.Kubelet.FeatureGates["InTreePluginAWSUnregister"] = "true"
} else if b.IsKubernetesGTE("1.31") {
delete(clusterSpec.Kubelet.FeatureGates, "InTreePluginAWSUnregister")
if _, found := clusterSpec.Kubelet.FeatureGates["CSIMigrationAWS"]; !found && b.IsKubernetesLT("1.27") {
clusterSpec.Kubelet.FeatureGates["CSIMigrationAWS"] = "true"
}
}

Expand Down
4 changes: 1 addition & 3 deletions pkg/model/components/kubescheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,8 @@ func (b *KubeSchedulerOptionsBuilder) BuildOptions(o interface{}) error {
config.FeatureGates = make(map[string]string)
}

if _, found := config.FeatureGates["InTreePluginAWSUnregister"]; !found {
if _, found := config.FeatureGates["InTreePluginAWSUnregister"]; !found && b.IsKubernetesLT("1.31") {
config.FeatureGates["InTreePluginAWSUnregister"] = "true"
} else if b.IsKubernetesGTE("1.31") {
delete(clusterSpec.Kubelet.FeatureGates, "InTreePluginAWSUnregister")
}

if _, found := config.FeatureGates["CSIMigrationAWS"]; !found && b.IsKubernetesLT("1.27") {
Expand Down
Loading