Skip to content
This repository was archived by the owner on Sep 30, 2020. It is now read-only.

Commit 7ed79b3

Browse files
Luke Humphreysdavidmccormick
Luke Humphreys
authored andcommitted
Fixing broken apiserver feature gate logic for 1.9.3 (#1593)
* Fixing broken apiserver feature gate logic for 1.9.3 * Making if statements cleaner
1 parent fba142b commit 7ed79b3

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

core/controlplane/config/config.go

+4-6
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"path/filepath"
1010
"regexp"
1111
"sort"
12+
"strconv"
1213
"strings"
1314
"unicode/utf8"
1415

@@ -362,12 +363,9 @@ func (c *Cluster) ControllerFeatureGates() model.FeatureGates {
362363
//From kube 1.11 PodPriority and ExpandPersistentVolumes have become enabled by default,
363364
//so making sure it is not enabled if user has explicitly set them to false
364365
//https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG-1.11.md#changelog-since-v1110
365-
if !c.Experimental.Admission.Priority.Enabled {
366-
gates["PodPriority"] = "false"
367-
}
368-
if !c.Experimental.Admission.PersistentVolumeClaimResize.Enabled {
369-
gates["ExpandPersistentVolumes"] = "false"
370-
}
366+
gates["PodPriority"] = strconv.FormatBool(c.Experimental.Admission.Priority.Enabled)
367+
gates["ExpandPersistentVolumes"] = strconv.FormatBool(c.Experimental.Admission.PersistentVolumeClaimResize.Enabled)
368+
371369
return gates
372370
}
373371

core/nodepool/config/config.go

+4-6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package config
22

33
import (
44
"fmt"
5+
"strconv"
56
"strings"
67

78
"github.com/go-yaml/yaml"
@@ -300,12 +301,9 @@ func (c ProvidedConfig) FeatureGates() model.FeatureGates {
300301
//From kube 1.11 PodPriority and ExpandPersistentVolumes have become enabled by default,
301302
//so making sure it is not enabled if user has explicitly set them to false
302303
//https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG-1.11.md#changelog-since-v1110
303-
if !c.Experimental.Admission.Priority.Enabled {
304-
gates["PodPriority"] = "false"
305-
}
306-
if !c.Experimental.Admission.PersistentVolumeClaimResize.Enabled {
307-
gates["ExpandPersistentVolumes"] = "false"
308-
}
304+
gates["PodPriority"] = strconv.FormatBool(c.Experimental.Admission.Priority.Enabled)
305+
gates["ExpandPersistentVolumes"] = strconv.FormatBool(c.Experimental.Admission.PersistentVolumeClaimResize.Enabled)
306+
309307
return gates
310308
}
311309

0 commit comments

Comments
 (0)