aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRitu Sood <ritu.sood@intel.com>2021-10-25 21:09:16 +0000
committerGerrit Code Review <gerrit@onap.org>2021-10-25 21:09:16 +0000
commited96bca7fe415f1636d82c26af15d7474bdfe876 (patch)
treead05180adf98d4d964a4885d5602da0a1e3ed151
parent6c28e5a7ca5a0688f5aefad010e0a3071ff6fe0b (diff)
parentb1bed1d5f80cf7dc3897cf6d6d310cd4e700967f (diff)
Merge "Update kernel version node selector in nfd test"
-rwxr-xr-xkud/tests/nfd.sh10
1 files changed, 7 insertions, 3 deletions
diff --git a/kud/tests/nfd.sh b/kud/tests/nfd.sh
index 1fb0f60e..9937cc65 100755
--- a/kud/tests/nfd.sh
+++ b/kud/tests/nfd.sh
@@ -66,15 +66,19 @@ POD
}
function create_pod_yaml_with_nodeSelector {
+ # Get the major kernel version of a worker node in the cluster:
+ # this will be used below in the node selector of the test pod
+ local -r node_name=$(kubectl get nodes -o jsonpath='{range .items[*]}{.metadata.name} {.spec.taints[?(@.effect=="NoSchedule")].effect}{"\n"}{end}' | awk 'NF==1 {print $0;exit}')
+ local -r kernel_version=$(kubectl get node ${node_name} -o jsonpath='{.metadata.labels.feature\.node\.kubernetes\.io/kernel-version\.major}')
-cat << POD > $HOME/$pod_name-nodeSelector.yaml
+ cat << POD > $HOME/$pod_name-nodeSelector.yaml
apiVersion: v1
kind: Pod
metadata:
- name: $pod_name
+ name: ${pod_name}
spec:
nodeSelector:
- feature.node.kubernetes.io/kernel-version.major: '4'
+ feature.node.kubernetes.io/kernel-version.major: '${kernel_version}'
containers:
- name: with-node-affinity
image: gcr.io/google_containers/pause:2.0