diff --git a/hack/libe2e.sh b/hack/libe2e.sh index 0125f3d85..0ca633ed4 100644 --- a/hack/libe2e.sh +++ b/hack/libe2e.sh @@ -253,6 +253,16 @@ function kube_create_pv() { local name="${1}" local capacity="${2}" local storage_class="${3}" + local schedulable_nodes + schedulable_nodes=$( + kubectl get nodes \ + --output \ + 'jsonpath={range $.items[*]}{.metadata.name} {.spec.taints[*].effect}{"\n"}{end}' \ + | grep -v NoSchedule) + local node_name + node_name=$(python -c 'import random,sys; print(random.choice(sys.argv[1:]))' $schedulable_nodes) + + local path="hostpath_pvs/${name}/" kubectl create --filename - <