Skip to content

Commit ef65658

Browse files
authored
Merge pull request #5385 from npinaeva/apiserver-client
Fix e2e ipv6 failures
2 parents 8334c00 + b1864a4 commit ef65658

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

contrib/kind-common

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,20 @@ command_exists() {
6363
detect_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

7482
docker_disable_ipv6() {

0 commit comments

Comments
 (0)