Skip to content

Commit

Permalink
e2e: adjust $VM_HOSTNAME for policy node config usage.
Browse files Browse the repository at this point in the history
Take into account that $VM_HOSTNAME's like xyzzy-foobar-22.04
will propagate to the VM distro hostname as xyzzy-foobar-22.

Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
  • Loading branch information
klihub authored and askervin committed Oct 7, 2024
1 parent f5f9f52 commit 572c29c
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions test/e2e/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -481,26 +481,31 @@ get-config-generation() {
vm-command-q "kubectl get -n kube-system $resource -ojsonpath={.metadata.generation}"
}

get-hostname-for-vm() {
local node="${node:-$VM_HOSTNAME}"
echo ${node%.*}
}

get-config-node-status-generation() {
local resource="$1" node="${node:-$VM_HOSTNAME}"
local resource="$1" node="$(get-hostname-for-vm)"
vm-command-q "kubectl get -n kube-system $resource \
-ojsonpath=\"{.status.nodes['$node'].generation}\""
}

get-config-node-status-result() {
local resource="$1" node="${node:-$VM_HOSTNAME}"
local resource="$1" node="$(get-hostname-for-vm)"
vm-command-q "kubectl get -n kube-system $resource \
-ojsonpath=\"{.status.nodes['$node'].status}\""
}

get-config-node-status-error() {
local resource="$1" node="${node:-$VM_HOSTNAME}"
local resource="$1" node="$(get-hostname-for-vm)"
vm-command-q "kubectl get -n kube-system $resource \
-ojsonpath=\"{.status.nodes['$node'].error}\""
}

wait-config-node-status() {
local resource="$1" node="${node:-$VM_HOSTNAME}"
local resource="$1" node="$(get-hostname-for-vm)"
local timeout="${timeout:-5s}"
local deadline=$(deadline-for-timeout $timeout)
local generation jsonpath result errors
Expand Down

0 comments on commit 572c29c

Please sign in to comment.