From 735629cef86961482a8bfc264e4972218c9261cd Mon Sep 17 00:00:00 2001 From: Bryce Soghigian Date: Tue, 13 Aug 2024 17:19:51 -0700 Subject: [PATCH 1/4] fix: DisableKubeletCloudCredentialProviders should default to false for 1.29 --- pkg/providers/imagefamily/bootstrap/aksbootstrap.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/providers/imagefamily/bootstrap/aksbootstrap.go b/pkg/providers/imagefamily/bootstrap/aksbootstrap.go index c064a8f7b..e8161c738 100644 --- a/pkg/providers/imagefamily/bootstrap/aksbootstrap.go +++ b/pkg/providers/imagefamily/bootstrap/aksbootstrap.go @@ -484,7 +484,7 @@ func (a AKS) applyOptions(nbv *NodeBootstrapVariables) { nbv.KubeletNodeLabels = strings.Join(lo.MapToSlice(kubeletLabels, func(k, v string) string { return fmt.Sprintf("%s=%s", k, v) }), ",") - + // Assign Per K8s version kubelet flags credentialProviderURL := CredentialProviderURL(a.KubernetesVersion, a.Arch) if credentialProviderURL != "" { // use OOT credential provider @@ -492,6 +492,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 From d7d18520e6bf8bc8d456f8745236b82f57be1c6b Mon Sep 17 00:00:00 2001 From: Bryce Soghigian Date: Tue, 13 Aug 2024 17:21:43 -0700 Subject: [PATCH 2/4] fix: adding 1.31 credential provider into switch --- pkg/providers/imagefamily/bootstrap/aksbootstrap.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/providers/imagefamily/bootstrap/aksbootstrap.go b/pkg/providers/imagefamily/bootstrap/aksbootstrap.go index e8161c738..8bd39c10f 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) From b61f5705643a9f4bbf492dd427cead26b77e0b41 Mon Sep 17 00:00:00 2001 From: Bryce Soghigian Date: Tue, 13 Aug 2024 17:25:18 -0700 Subject: [PATCH 3/4] test: testing 1.31 credential provider url --- pkg/providers/imagefamily/bootstrap/aksbootstrap_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/providers/imagefamily/bootstrap/aksbootstrap_test.go b/pkg/providers/imagefamily/bootstrap/aksbootstrap_test.go index ec0cb423f..04712db12 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", From 46e90fe82af64e2e53186cde968fdf3b43f83acf Mon Sep 17 00:00:00 2001 From: Bryce Soghigian Date: Tue, 13 Aug 2024 19:19:00 -0700 Subject: [PATCH 4/4] fix: ci --- pkg/providers/imagefamily/bootstrap/aksbootstrap.go | 8 ++++---- pkg/providers/imagefamily/bootstrap/aksbootstrap_test.go | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/providers/imagefamily/bootstrap/aksbootstrap.go b/pkg/providers/imagefamily/bootstrap/aksbootstrap.go index 8bd39c10f..51ee7e2c3 100644 --- a/pkg/providers/imagefamily/bootstrap/aksbootstrap.go +++ b/pkg/providers/imagefamily/bootstrap/aksbootstrap.go @@ -438,7 +438,7 @@ func CredentialProviderURL(kubernetesVersion, arch string) string { case 30: credentialProviderVersion = "1.30.0" - case 31: + case 31: credentialProviderVersion = "1.31.0" } @@ -487,7 +487,7 @@ func (a AKS) applyOptions(nbv *NodeBootstrapVariables) { nbv.KubeletNodeLabels = strings.Join(lo.MapToSlice(kubeletLabels, func(k, v string) string { return fmt.Sprintf("%s=%s", k, v) }), ",") - + // Assign Per K8s version kubelet flags credentialProviderURL := CredentialProviderURL(a.KubernetesVersion, a.Arch) if credentialProviderURL != "" { // use OOT credential provider @@ -495,8 +495,8 @@ 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. + // 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" } diff --git a/pkg/providers/imagefamily/bootstrap/aksbootstrap_test.go b/pkg/providers/imagefamily/bootstrap/aksbootstrap_test.go index 04712db12..0d3c3764b 100644 --- a/pkg/providers/imagefamily/bootstrap/aksbootstrap_test.go +++ b/pkg/providers/imagefamily/bootstrap/aksbootstrap_test.go @@ -67,7 +67,7 @@ func TestGetCredentialProviderURL(t *testing.T) { }{ { version: "1.31.0", - arch: "amd64", + 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), }, {