From 953c68b808ef7f9b47c63ec0d3423ab098105c19 Mon Sep 17 00:00:00 2001 From: Richard Wall Date: Tue, 5 Jun 2018 15:41:03 +0100 Subject: [PATCH] Use local volumes instead of hostpath volumes --- hack/libe2e.sh | 64 ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 62 insertions(+), 2 deletions(-) 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 - <