From 43aa36840808d115719c8493eb98127171845e90 Mon Sep 17 00:00:00 2001 From: Bryce Soghigian <49734722+Bryce-Soghigian@users.noreply.github.com> Date: Thu, 30 May 2024 18:56:11 +0000 Subject: [PATCH] fix: 1.30 ci --- hack/toolchain.sh | 2 +- pkg/providers/instancetype/suite_test.go | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/hack/toolchain.sh b/hack/toolchain.sh index b28f2c9f7..05a9690d1 100755 --- a/hack/toolchain.sh +++ b/hack/toolchain.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -euo pipefail -K8S_VERSION="${K8S_VERSION:="1.29.x"}" +K8S_VERSION="${K8S_VERSION:="1.30.x"}" KUBEBUILDER_ASSETS="/usr/local/kubebuilder/bin" main() { diff --git a/pkg/providers/instancetype/suite_test.go b/pkg/providers/instancetype/suite_test.go index b59782de6..050fed6a3 100644 --- a/pkg/providers/instancetype/suite_test.go +++ b/pkg/providers/instancetype/suite_test.go @@ -27,6 +27,7 @@ import ( "testing" "time" + "github.com/blang/semver/v4" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/samber/lo" @@ -1105,8 +1106,6 @@ var _ = Describe("InstanceType Provider", func() { decodedBytes, err := base64.StdEncoding.DecodeString(customData) Expect(err).To(Succeed()) decodedString := string(decodedBytes[:]) - - fmt.Println(env.Version) Expect(decodedString).To(ContainSubstring("CREDENTIAL_PROVIDER_DOWNLOAD_URL")) Expect(decodedString).To(ContainSubstring( fmt.Sprintf("https://acs-mirror.azureedge.net/cloud-provider-azure/%s/binaries/azure-acr-credential-provider-linux-amd64-v%s.tar.gz", env.Version.String(), env.Version.String()), @@ -1127,7 +1126,12 @@ var _ = Describe("InstanceType Provider", func() { // TODO: (bsoghigian) leverage the helpers from the azure cni pr once they get in instead for testing kubelet flags flagMap := parseKubeletFlags(kubeletFlags) - if env.Version.Minor() < 30 { + // NOTE: env.Version may differ from the version we get for the apiserver + k8sVersion, err := azureEnv.ImageProvider.KubeServerVersion(ctx) + Expect(err).To(BeNil()) + parsed := semver.MustParse(k8sVersion) + if parsed.Minor < 30 { + fmt.Println("K8s Version for env client: ") Expect(flagMap).To(HaveKey("--azure-container-registry-config")) Expect(flagMap).ToNot(HaveKey("--image-credential-provider-config")) Expect(flagMap).ToNot(HaveKey("--image-credential-provider-bin-dir"))