Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions hack/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,18 @@ capz::util::should_build_kubernetes() {
}

capz::util::should_build_ccm() {
# TEST_CCM is an environment variable set by a prow job to indicate that the CCM should be built and tested.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the comments!

if [[ -n "${TEST_CCM:-}" ]]; then
echo "true" && return
fi
# If conformance is being tested with CI artifacts, CCM should be built.
if [[ "${E2E_ARGS:-}" == "-kubetest.use-ci-artifacts" ]]; then
echo "true" && return
fi
# If the Kubernetes version contains "latest", CCM should be built.
if [[ "${KUBERNETES_VERSION:-}" =~ "latest" ]]; then
echo "true" && return
fi
echo "false"
}

Expand Down
2 changes: 1 addition & 1 deletion scripts/ci-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ setup() {
# setup REGISTRY for custom images.
: "${REGISTRY:?Environment variable empty or not defined.}"
"${REPO_ROOT}/hack/ensure-acr-login.sh"
if [[ -n "${TEST_CCM:-}" ]]; then
if [[ "$(capz::util::should_build_ccm)" == "true" ]]; then
# shellcheck source=scripts/ci-build-azure-ccm.sh
source "${REPO_ROOT}/scripts/ci-build-azure-ccm.sh"
echo "Will use the ${IMAGE_REGISTRY}/${CCM_IMAGE_NAME}:${IMAGE_TAG} cloud-controller-manager image for external cloud-provider-cluster"
Expand Down