Skip to content

Commit

Permalink
Keep kubelet's --cloud-provider flag even for 1.23+ (#520)
Browse files Browse the repository at this point in the history
Co-authored-by: Rafael Franzke <rafael.franzke@sap.com>
  • Loading branch information
ialidzhikov and rfranzke authored Mar 11, 2022
1 parent 8b5df87 commit 396be0b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/webhook/controlplane/ensurer.go
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,8 @@ func (e *ensurer) EnsureKubeletServiceUnitOptions(ctx context.Context, gctx gcon

func ensureKubeletCommandLineArgs(command []string, csiEnabled bool, kubeletVersion *semver.Version) []string {
if csiEnabled {
command = extensionswebhook.EnsureStringWithPrefix(command, "--cloud-provider=", "external")
if !version.ConstraintK8sGreaterEqual123.Check(kubeletVersion) {
command = extensionswebhook.EnsureStringWithPrefix(command, "--cloud-provider=", "external")
command = extensionswebhook.EnsureStringWithPrefix(command, "--enable-controller-attach-detach=", "true")
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion pkg/webhook/controlplane/ensurer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ done
Entry("kubelet version < 1.17", eContextK8s116, semver.MustParse("1.16.0"), "aws", false),
Entry("1.17 <= kubelet version < 1.18", eContextK8s117, semver.MustParse("1.17.0"), "aws", false),
Entry("1.18 <= kubelet version < 1.23", eContextK8s118, semver.MustParse("1.18.0"), "external", true),
Entry("kubelet version >= 1.23", eContextK8s118, semver.MustParse("1.23.0"), "", false),
Entry("kubelet version >= 1.23", eContextK8s118, semver.MustParse("1.23.0"), "external", false),
)
})

Expand Down

0 comments on commit 396be0b

Please sign in to comment.