diff options
author | Todd Malsbary <todd.malsbary@intel.com> | 2021-10-14 13:56:25 -0700 |
---|---|---|
committer | Todd Malsbary <todd.malsbary@intel.com> | 2021-10-22 11:14:09 -0700 |
commit | b1bed1d5f80cf7dc3897cf6d6d310cd4e700967f (patch) | |
tree | 45ac8bb233cff254ac46e77dcc4fe4555e2e6362 | |
parent | a6729589f63719580a404513db4846b98c16b455 (diff) |
Update kernel version node selector in nfd test
Issue-ID: MULTICLOUD-1413
Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
Change-Id: I4f15f987ffb739544fd4c62f8f57ab38864bbbb3
-rwxr-xr-x | kud/tests/nfd.sh | 10 |
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 |