From a43b9940731b3fb51e59de6a5442dca1bb80da57 Mon Sep 17 00:00:00 2001 From: Bryce Soghigian <49734722+Bryce-Soghigian@users.noreply.github.com> Date: Wed, 21 Aug 2024 23:29:36 -0700 Subject: [PATCH] fix: set `DisableKubeletCloudCredentialProviders=false` for versions without OOT credential provider (1.29) (#456) * fix: DisableKubeletCloudCredentialProviders should default to false for 1.29 * fix: adding 1.31 credential provider into switch * test: testing 1.31 credential provider url * fix: ci --------- Co-authored-by: Alex Leites <18728999+tallaxes@users.noreply.github.com> --- pkg/providers/imagefamily/bootstrap/aksbootstrap.go | 6 ++++++ pkg/providers/imagefamily/bootstrap/aksbootstrap_test.go | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/pkg/providers/imagefamily/bootstrap/aksbootstrap.go b/pkg/providers/imagefamily/bootstrap/aksbootstrap.go index 83014232b..e337e4188 100644 --- a/pkg/providers/imagefamily/bootstrap/aksbootstrap.go +++ b/pkg/providers/imagefamily/bootstrap/aksbootstrap.go @@ -437,6 +437,9 @@ func CredentialProviderURL(kubernetesVersion, arch string) string { credentialProviderVersion = "1.29.2" case 30: credentialProviderVersion = "1.30.0" + + case 31: + credentialProviderVersion = "1.31.0" } return fmt.Sprintf("%s/cloud-provider-azure/v%s/binaries/azure-acr-credential-provider-linux-%s-v%s.tar.gz", globalAKSMirror, credentialProviderVersion, arch, credentialProviderVersion) @@ -497,6 +500,9 @@ func (a AKS) applyOptions(nbv *NodeBootstrapVariables) { kubeletFlagsBase["--image-credential-provider-config"] = "/var/lib/kubelet/credential-provider-config.yaml" kubeletFlagsBase["--image-credential-provider-bin-dir"] = "/var/lib/kubelet/credential-provider" } else { // Versions Less than 1.30 + // we can make this logic smarter later when we have more than one + // for now just adding here. + kubeletFlagsBase["--feature-gates"] = "DisableKubeletCloudCredentialProviders=false" kubeletFlagsBase["--azure-container-registry-config"] = "/etc/kubernetes/azure.json" } // merge and stringify taints diff --git a/pkg/providers/imagefamily/bootstrap/aksbootstrap_test.go b/pkg/providers/imagefamily/bootstrap/aksbootstrap_test.go index ec0cb423f..0d3c3764b 100644 --- a/pkg/providers/imagefamily/bootstrap/aksbootstrap_test.go +++ b/pkg/providers/imagefamily/bootstrap/aksbootstrap_test.go @@ -65,6 +65,11 @@ func TestGetCredentialProviderURL(t *testing.T) { arch string url string }{ + { + version: "1.31.0", + arch: "amd64", + url: fmt.Sprintf("%s/cloud-provider-azure/v1.31.0/binaries/azure-acr-credential-provider-linux-amd64-v1.31.0.tar.gz", globalAKSMirror), + }, { version: "1.30.2", arch: "amd64",