Skip to content

Commit 4a7b93d

Browse files
Build CCM when using k8s version latest in ci-entrypoint
1 parent c77b528 commit 4a7b93d

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
@@ -50,7 +50,7 @@ setup() {
5050
# setup REGISTRY for custom images.
5151
: "${REGISTRY:?Environment variable empty or not defined.}"
5252
"${REPO_ROOT}/hack/ensure-acr-login.sh"
53-
if [[ -n "${TEST_CCM:-}" ]]; then
53+
if [[ "$(capz::util::should_build_ccm)" == "true" ]]; then
5454
# shellcheck source=scripts/ci-build-azure-ccm.sh
5555
source "${REPO_ROOT}/scripts/ci-build-azure-ccm.sh"
5656
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)