aboutsummaryrefslogtreecommitdiffstats
path: root/kud/tests/_functions.sh
diff options
context:
space:
mode:
Diffstat (limited to 'kud/tests/_functions.sh')
-rwxr-xr-xkud/tests/_functions.sh7
1 files changed, 5 insertions, 2 deletions
diff --git a/kud/tests/_functions.sh b/kud/tests/_functions.sh
index ec415409..367888e5 100755
--- a/kud/tests/_functions.sh
+++ b/kud/tests/_functions.sh
@@ -29,9 +29,12 @@ function print_msg {
echo -e "${RED} $msg ---------------------------------------${NC}"
}
+function control_plane_ip {
+ kubectl get endpoints kubernetes -o jsonpath='{.subsets[].addresses[].ip}'
+}
+
function ssh_cluster {
- master_ip=$(kubectl cluster-info | grep "Kubernetes master" | awk -F '[:/]' '{print $4}')
- ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ${master_ip} -- "$@"
+ ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null $(control_plane_ip) -- "$@"
}
function get_ovn_central_address {