File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -188,6 +188,15 @@ export ARTIFACTS="${ARTIFACTS:-${PWD}/_artifacts}"
188188# create cluster
189189create_cluster
190190
191+ # Get CCM cluster CIDRs from Cluster object if not set
192+ if [[ -z " ${CCM_CLUSTER_CIDR:- } " ]]; then
193+ CCM_CLUSTER_CIDR=$( ${KUBECTL} get cluster " ${CLUSTER_NAME} " -o=jsonpath=' {.spec.clusterNetwork.pods.cidrBlocks[0]}' )
194+ if CIDR1=$( ${KUBECTL} get cluster " ${CLUSTER_NAME} " -o=jsonpath=' {.spec.clusterNetwork.pods.cidrBlocks[1]}' 2> /dev/null) ; then
195+ CCM_CLUSTER_CIDR=" ${CCM_CLUSTER_CIDR:- } \,${CIDR1} "
196+ fi
197+ fi
198+ echo " CCM cluster CIDR: ${CCM_CLUSTER_CIDR:- } "
199+
191200# export the target cluster KUBECONFIG if not already set
192201export KUBECONFIG=" ${KUBECONFIG:- ${PWD} / kubeconfig} "
193202
@@ -225,7 +234,8 @@ if [[ -n "${TEST_CCM:-}" ]]; then
225234 --set cloudControllerManager.enableDynamicReloading=" ${ENABLE_DYNAMIC_RELOADING} " \
226235 --set cloudControllerManager.cloudConfig=" ${CLOUD_CONFIG} " \
227236 --set cloudControllerManager.cloudConfigSecretName=" ${CONFIG_SECRET_NAME} " \
228- --set cloudControllerManager.logVerbosity=" ${CCM_LOG_VERBOSITY} "
237+ --set cloudControllerManager.logVerbosity=" ${CCM_LOG_VERBOSITY} " \
238+ --set-string cloudControllerManager.clusterCIDR=" ${CCM_CLUSTER_CIDR} "
229239
230240 echo " Waiting for all kube-system pods to be ready"
231241 " ${KUBECTL} " wait --for=condition=Ready pod -n kube-system --all --timeout=10m
You can’t perform that action at this time.
0 commit comments