Răsfoiți Sursa

fix(e2e): get kgctl path and update taint

If the kgctl path is not passed explicitly via an environment variable,
then we need to resolve the path. Additionally, in more recent versions
of k8s, the taint on control-plane nodes has changed names so we need to
update our code to correctly untaint them.

Signed-off-by: squat <lserven@gmail.com>
squat 2 luni în urmă
părinte
comite
2342e4e4eb
2 a modificat fișierele cu 3 adăugiri și 3 ștergeri
  1. 2 2
      e2e/kgctl.sh
  2. 1 1
      e2e/lib.sh

+ 2 - 2
e2e/kgctl.sh

@@ -11,13 +11,13 @@ setup_suite() {
 test_connect() {
 test_connect() {
 	local PEER=test
 	local PEER=test
 	local ALLOWED_IP=10.5.0.1/32
 	local ALLOWED_IP=10.5.0.1/32
-        docker run -d --name="$PEER" --rm --network=host --cap-add=NET_ADMIN -v "$KGCTL_BINARY":/kgctl -v "$PWD/$KUBECONFIG":/kubeconfig --entrypoint=/kgctl alpine --kubeconfig /kubeconfig connect "$PEER" --allowed-ip "$ALLOWED_IP"
+        docker run -d --name="$PEER" --rm --network=host --cap-add=NET_ADMIN -v "$(which "$KGCTL_BINARY")":/kgctl -v "$PWD/$KUBECONFIG":/kubeconfig --entrypoint=/kgctl alpine --kubeconfig /kubeconfig connect "$PEER" --allowed-ip "$ALLOWED_IP"
 	assert "retry 10 5 '' check_ping --local" "should be able to ping Pods from host"
 	assert "retry 10 5 '' check_ping --local" "should be able to ping Pods from host"
         docker stop "$PEER"
         docker stop "$PEER"
 
 
 	local PEER=test-hostname
 	local PEER=test-hostname
 	local ALLOWED_IP=10.5.0.1/32
 	local ALLOWED_IP=10.5.0.1/32
-        docker run -d --name="$PEER" --rm --network=host --cap-add=NET_ADMIN -v "$KGCTL_BINARY":/kgctl -v "$PWD/$KUBECONFIG":/kubeconfig --entrypoint=/kgctl alpine --kubeconfig /kubeconfig connect --allowed-ip "$ALLOWED_IP"
+        docker run -d --name="$PEER" --rm --network=host --cap-add=NET_ADMIN -v "$(which "$KGCTL_BINARY")":/kgctl -v "$PWD/$KUBECONFIG":/kubeconfig --entrypoint=/kgctl alpine --kubeconfig /kubeconfig connect --allowed-ip "$ALLOWED_IP"
 	assert "retry 10 5 '' check_ping --local" "should be able to ping Pods from host using auto-discovered name"
 	assert "retry 10 5 '' check_ping --local" "should be able to ping Pods from host using auto-discovered name"
         docker stop "$PEER"
         docker stop "$PEER"
 }
 }

+ 1 - 1
e2e/lib.sh

@@ -133,7 +133,7 @@ create_cluster() {
 	# Ensure the curl helper is not scheduled on a control-plane node.
 	# Ensure the curl helper is not scheduled on a control-plane node.
 	_kubectl apply -f helper-curl.yaml
 	_kubectl apply -f helper-curl.yaml
 	block_until_ready_by_name default curl
 	block_until_ready_by_name default curl
-	_kubectl taint node $KIND_CLUSTER-control-plane node-role.kubernetes.io/master:NoSchedule-
+	_kubectl taint node $KIND_CLUSTER-control-plane node-role.kubernetes.io/control-plane:NoSchedule-
 	_kubectl apply -f https://raw.githubusercontent.com/kilo-io/adjacency/main/example.yaml
 	_kubectl apply -f https://raw.githubusercontent.com/kilo-io/adjacency/main/example.yaml
 	block_until_ready_by_name default adjacency
 	block_until_ready_by_name default adjacency
 }
 }