Skip to content

Commit 832f8fe

Browse files
authored
Merge pull request #3233 from CecileRobertMichon/fix-csi-ccm
Build CCM when using k8s version latest in ci-entrypoint
2 parents 526267a + 4a7b93d commit 832f8fe

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

hack/util.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,18 @@ capz::util::should_build_kubernetes() {
4242
}
4343

4444
capz::util::should_build_ccm() {
45+
# TEST_CCM is an environment variable set by a prow job to indicate that the CCM should be built and tested.
4546
if [[ -n "${TEST_CCM:-}" ]]; then
4647
echo "true" && return
4748
fi
49+
# If conformance is being tested with CI artifacts, CCM should be built.
4850
if [[ "${E2E_ARGS:-}" == "-kubetest.use-ci-artifacts" ]]; then
4951
echo "true" && return
5052
fi
53+
# If the Kubernetes version contains "latest", CCM should be built.
54+
if [[ "${KUBERNETES_VERSION:-}" =~ "latest" ]]; then
55+
echo "true" && return
56+
fi
5157
echo "false"
5258
}
5359

scripts/ci-entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ setup() {
5252
# setup REGISTRY for custom images.
5353
: "${REGISTRY:?Environment variable empty or not defined.}"
5454
"${REPO_ROOT}/hack/ensure-acr-login.sh"
55-
if [[ -n "${TEST_CCM:-}" ]]; then
55+
if [[ "$(capz::util::should_build_ccm)" == "true" ]]; then
5656
# shellcheck source=scripts/ci-build-azure-ccm.sh
5757
source "${REPO_ROOT}/scripts/ci-build-azure-ccm.sh"
5858
echo "Will use the ${IMAGE_REGISTRY}/${CCM_IMAGE_NAME}:${IMAGE_TAG} cloud-controller-manager image for external cloud-provider-cluster"

0 commit comments

Comments
 (0)