Skip to content

Commit

Permalink
Merge pull request #3358 from lzhecheng/flexible-cpa-env-var
Browse files Browse the repository at this point in the history
[e2e] Support more flexible env var for cloud-provider-azure
  • Loading branch information
k8s-ci-robot authored Apr 3, 2023
2 parents dddbac9 + 44e06aa commit 93443fa
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
4 changes: 3 additions & 1 deletion scripts/ci-build-azure-ccm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ setup() {

# the azure-cloud-provider repo expects IMAGE_REGISTRY.
export IMAGE_REGISTRY=${REGISTRY}
pushd "${AZURE_CLOUD_PROVIDER_ROOT}" && IMAGE_TAG=$(git rev-parse --short=7 HEAD) && export IMAGE_TAG && popd
pushd "${AZURE_CLOUD_PROVIDER_ROOT}" && IMAGE_TAG=$(git rev-parse --short=7 HEAD) &&
IMAGE_TAG_CCM="${IMAGE_TAG_CCM:-${IMAGE_TAG}}" && IMAGE_TAG_CNM="${IMAGE_TAG_CNM:-${IMAGE_TAG}}" &&
export IMAGE_TAG && export IMAGE_TAG_CCM && export IMAGE_TAG_CNM && popd
echo "Image registry is ${REGISTRY}"
echo "Image Tag is ${IMAGE_TAG}"

Expand Down
7 changes: 7 additions & 0 deletions scripts/ci-e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ if [[ "${BUILD_MANAGER_IMAGE}" == "true" ]]; then
export TAG="${defaultTag:-dev}"
fi

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"
echo "Will use the ${IMAGE_REGISTRY}/${CNM_IMAGE_NAME}:${IMAGE_TAG} cloud-node-manager image for external cloud-provider-azure cluster"
fi

export GINKGO_NODES=10

export AZURE_LOCATION="${AZURE_LOCATION:-$(capz::util::get_random_region)}"
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/cloud-provider-azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ func InstallCalicoAndCloudProviderAzureHelmChart(ctx context.Context, input clus
options.Values = append(options.Values, fmt.Sprintf("cloudNodeManager.imageName=%s", os.Getenv("CNM_IMAGE_NAME")))
options.Values = append(options.Values, fmt.Sprintf("cloudControllerManager.imageRepository=%s", os.Getenv("IMAGE_REGISTRY")))
options.Values = append(options.Values, fmt.Sprintf("cloudNodeManager.imageRepository=%s", os.Getenv("IMAGE_REGISTRY")))
options.StringValues = append(options.StringValues, fmt.Sprintf("cloudControllerManager.imageTag=%s", os.Getenv("IMAGE_TAG")))
options.StringValues = append(options.StringValues, fmt.Sprintf("cloudNodeManager.imageTag=%s", os.Getenv("IMAGE_TAG")))
options.StringValues = append(options.StringValues, fmt.Sprintf("cloudControllerManager.imageTag=%s", os.Getenv("IMAGE_TAG_CCM")))
options.StringValues = append(options.StringValues, fmt.Sprintf("cloudNodeManager.imageTag=%s", os.Getenv("IMAGE_TAG_CNM")))
}

clusterProxy := input.ClusterProxy.GetWorkloadCluster(ctx, input.ConfigCluster.Namespace, input.ConfigCluster.ClusterName)
Expand Down

0 comments on commit 93443fa

Please sign in to comment.