Skip to content

Commit c12205e

Browse files
authored
Merge pull request #3299 from k8s-infra-cherrypick-robot/cherry-pick-3272-to-release-1.8
[release-1.8] ci-entrypoint points to correct kubeconfig
2 parents 19309cf + 387edf0 commit c12205e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

scripts/ci-entrypoint.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,11 @@ create_cluster() {
147147
# and any statement must be idempotent so that subsequent retry attempts can make forward progress.
148148
get_cidrs() {
149149
# Get cluster CIDRs from Cluster object
150-
CIDR0=$(${KUBECTL} get cluster "${CLUSTER_NAME}" -o=jsonpath='{.spec.clusterNetwork.pods.cidrBlocks[0]}')
150+
CIDR0=$(${KUBECTL} --kubeconfig "${REPO_ROOT}/${KIND_CLUSTER_NAME}.kubeconfig" get cluster "${CLUSTER_NAME}" -o=jsonpath='{.spec.clusterNetwork.pods.cidrBlocks[0]}')
151151
export CIDR0
152-
CIDR_LENGTH=$(${KUBECTL} get cluster "${CLUSTER_NAME}" -o=jsonpath='{.spec.clusterNetwork.pods.cidrBlocks}' | jq '. | length')
152+
CIDR_LENGTH=$(${KUBECTL} --kubeconfig "${REPO_ROOT}/${KIND_CLUSTER_NAME}.kubeconfig" get cluster "${CLUSTER_NAME}" -o=jsonpath='{.spec.clusterNetwork.pods.cidrBlocks}' | jq '. | length')
153153
if [[ "${CIDR_LENGTH}" == "2" ]]; then
154-
CIDR1=$(${KUBECTL} get cluster "${CLUSTER_NAME}" -o=jsonpath='{.spec.clusterNetwork.pods.cidrBlocks[1]}')
154+
CIDR1=$(${KUBECTL} get cluster --kubeconfig "${REPO_ROOT}/${KIND_CLUSTER_NAME}.kubeconfig" "${CLUSTER_NAME}" -o=jsonpath='{.spec.clusterNetwork.pods.cidrBlocks[1]}')
155155
export CIDR1
156156
fi
157157
}
@@ -161,7 +161,7 @@ get_cidrs() {
161161
# retry it using a `until get_cloud_provider; do sleep 5; done` pattern;
162162
# and any statement must be idempotent so that subsequent retry attempts can make forward progress.
163163
get_cloud_provider() {
164-
CLOUD_PROVIDER=$("${KUBECTL}" get kubeadmcontrolplane -l cluster.x-k8s.io/cluster-name="${CLUSTER_NAME}" -o=jsonpath='{.items[0].spec.kubeadmConfigSpec.clusterConfiguration.controllerManager.extraArgs.cloud-provider}')
164+
CLOUD_PROVIDER=$("${KUBECTL}" --kubeconfig "${REPO_ROOT}/${KIND_CLUSTER_NAME}.kubeconfig" get kubeadmcontrolplane -l cluster.x-k8s.io/cluster-name="${CLUSTER_NAME}" -o=jsonpath='{.items[0].spec.kubeadmConfigSpec.clusterConfiguration.controllerManager.extraArgs.cloud-provider}')
165165
if [[ "${CLOUD_PROVIDER:-}" = "azure" ]]; then
166166
IN_TREE="true"
167167
export IN_TREE

0 commit comments

Comments
 (0)