Skip to content

Commit

Permalink
HACK: use dev build of cloud-provider in e2e and Tiltfile
Browse files Browse the repository at this point in the history
  • Loading branch information
mboersma committed Nov 29, 2022
1 parent e6c56b1 commit 9b5d65b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
6 changes: 4 additions & 2 deletions Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,10 @@ def deploy_worker_templates(template, substitutions):
yaml = yaml.replace('"', '\\"') # add escape character to double quotes in yaml
flavor_name = os.path.basename(flavor)
flavor_cmd = "RANDOM=$(bash -c 'echo $RANDOM'); CLUSTER_NAME=" + flavor.replace("windows", "win") + "-$RANDOM; make generate-flavors; echo \"" + yaml + "\" > ./.tiltbuild/" + flavor + "; cat ./.tiltbuild/" + flavor + " | " + envsubst_cmd + " | " + kubectl_cmd + " apply -f - && echo \"Cluster \'$CLUSTER_NAME\' created, don't forget to delete\""
if "external-cloud-provider" in flavor_name:
flavor_cmd += "; until " + kubectl_cmd + " get secret ${CLUSTER_NAME}-kubeconfig > /dev/null 2>&1; do sleep 5; done; " + kubectl_cmd + " get secret ${CLUSTER_NAME}-kubeconfig -o jsonpath={.data.value} | base64 --decode > ./${CLUSTER_NAME}.kubeconfig; chmod 600 ./${CLUSTER_NAME}.kubeconfig; until " + kubectl_cmd + " --kubeconfig=./${CLUSTER_NAME}.kubeconfig get nodes > /dev/null 2>&1; do sleep 5; done; " + helm_cmd + " --kubeconfig ./${CLUSTER_NAME}.kubeconfig install --repo https://raw.githubusercontent.com/kubernetes-sigs/cloud-provider-azure/master/helm/repo cloud-provider-azure --generate-name --set infra.clusterName=${CLUSTER_NAME}"
if "external-cloud-provider" in flavor_name or "flex" in flavor_name:
flavor_cmd += "; until " + kubectl_cmd + " get secret ${CLUSTER_NAME}-kubeconfig > /dev/null 2>&1; do sleep 5; done; " + kubectl_cmd + " get secret ${CLUSTER_NAME}-kubeconfig -o jsonpath={.data.value} | base64 --decode > ./${CLUSTER_NAME}.kubeconfig; chmod 600 ./${CLUSTER_NAME}.kubeconfig; until " + kubectl_cmd + " --kubeconfig=./${CLUSTER_NAME}.kubeconfig get nodes > /dev/null 2>&1; do sleep 5; done; " + helm_cmd + " --kubeconfig ./${CLUSTER_NAME}.kubeconfig install --repo https://raw.githubusercontent.com/kubernetes-sigs/cloud-provider-azure/master/helm/repo cloud-provider-azure --generate-name --set infra.clusterName=${CLUSTER_NAME}" + \
" --set cloudControllerManager.imageRepository=mbdevregistry.azurecr.io --set cloudControllerManager.imageName=azure-cloud-controller-manager --set cloudControllerManager.imageTag=latest" + \
" --set cloudNodeManager.imageRepository=mbdevregistry.azurecr.io --set cloudNodeManager.imageName=azure-cloud-node-manager --set cloudNodeManager.imageTag=latest"
local_resource(
name = flavor_name,
cmd = flavor_cmd,
Expand Down
11 changes: 10 additions & 1 deletion test/e2e/cloud-provider-azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,16 @@ const (
func InstallCloudProviderAzureHelmChart(ctx context.Context, input clusterctl.ApplyClusterTemplateAndWaitInput) {
specName := "cloud-provider-azure-install"
By("Installing the correct version of cloud-provider-azure components via helm")
values := []string{fmt.Sprintf("infra.clusterName=%s", input.ConfigCluster.ClusterName)}
values := []string{
fmt.Sprintf("infra.clusterName=%s", input.ConfigCluster.ClusterName),
// HACK: use dev build of cloud-provider-azure for VMSS Flex support
"cloudControllerManager.imageRepository=mbdevregistry.azurecr.io",
"cloudControllerManager.imageName=azure-cloud-controller-manager",
"cloudControllerManager.imageTag=latest",
"cloudNodeManager.imageRepository=mbdevregistry.azurecr.io",
"cloudNodeManager.imageName=azure-cloud-node-manager",
"cloudNodeManager.imageTag=latest",
}
InstallHelmChart(ctx, input, cloudProviderAzureHelmRepoURL, cloudProviderAzureChartName, cloudProviderAzureHelmReleaseName, values)
clusterProxy := input.ClusterProxy.GetWorkloadCluster(ctx, input.ConfigCluster.Namespace, input.ConfigCluster.ClusterName)
workloadClusterClient := clusterProxy.GetClient()
Expand Down

0 comments on commit 9b5d65b

Please sign in to comment.