File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -63,12 +63,20 @@ command_exists() {
6363detect_apiserver_url() {
6464 # Detect API_URL used for in-cluster communication
6565 #
66- # Despite OVN run in pod they will only obtain the VIRTUAL apiserver address
67- # and since OVN has to provide the connectivity to service
68- # it can not be bootstrapped
69- #
70- # This is the address of the node with the control-plane
71- API_URL=$(kind get kubeconfig --internal --name "${KIND_CLUSTER_NAME}" | grep server | awk '{ print $2 }')
66+ # This will return apiserver address in format https://<node-name>:<port>
67+ DNS_NAME_URL=$(kind get kubeconfig --internal --name "${KIND_CLUSTER_NAME}" | grep server | awk '{ print $2 }')
68+ # cut https:// from the URL
69+ CP_NODE=${DNS_NAME_URL#*//}
70+ # cut port from the URL
71+ CP_NODE=${CP_NODE%:*}
72+ # find node IP address in the kind network
73+ if [ "$PLATFORM_IPV4_SUPPORT" == false ] && [ "$PLATFORM_IPV6_SUPPORT" == true ]; then
74+ NODE_IP="[$($OCI_BIN inspect -f '{{.NetworkSettings.Networks.kind.GlobalIPv6Address}}' $CP_NODE)]"
75+ else
76+ NODE_IP=$($OCI_BIN inspect -f '{{.NetworkSettings.Networks.kind.IPAddress}}' "$CP_NODE")
77+ fi
78+ # replace node name with node IP address
79+ API_URL=${DNS_NAME_URL/$CP_NODE/$NODE_IP}
7280}
7381
7482docker_disable_ipv6() {
You can’t perform that action at this time.
0 commit comments