From 73d86181ffa115a243ff1fe357b5bb30f8ed4dd2 Mon Sep 17 00:00:00 2001
From: Ryan Taylor <1686627+rptaylor@users.noreply.github.com>
Date: Thu, 11 Apr 2024 10:31:41 -0700
Subject: [PATCH] add node_selector_enabled variable

---
 helm/amd-gpu/README.md                             | 1 +
 helm/amd-gpu/templates/deviceplugin-daemonset.yaml | 2 +-
 helm/amd-gpu/templates/labeller.yaml               | 2 +-
 helm/amd-gpu/values.yaml                           | 1 +
 4 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/helm/amd-gpu/README.md b/helm/amd-gpu/README.md
index c94f53dd..6a817d9a 100644
--- a/helm/amd-gpu/README.md
+++ b/helm/amd-gpu/README.md
@@ -26,6 +26,7 @@ Kubernetes: `>= 1.18.0`
 | lbl.image.tag | string | `"labeller-latest"` |  |
 | namespace | string | `"kube-system"` |  |
 | nfd.enabled | bool | `false` |  |
+| node_selector_enabled | bool | `false` |  |
 | node_selector."feature.node.kubernetes.io/pci-0300_1002.present" | string | `"true"` |  |
 | securityContext.allowPrivilegeEscalation | bool | `false` |  |
 | securityContext.capabilities.drop[0] | string | `"ALL"` |  |
diff --git a/helm/amd-gpu/templates/deviceplugin-daemonset.yaml b/helm/amd-gpu/templates/deviceplugin-daemonset.yaml
index 833f6298..bf6a181d 100644
--- a/helm/amd-gpu/templates/deviceplugin-daemonset.yaml
+++ b/helm/amd-gpu/templates/deviceplugin-daemonset.yaml
@@ -16,7 +16,7 @@ spec:
       imagePullSecrets:
         {{- toYaml . | nindent 8 }}
       {{- end }}
-      {{- if .Values.nfd.enabled }}
+      {{- if .Values.node_selector_enabled }}
       {{- with .Values.node_selector }}
       nodeSelector:
         {{- toYaml . | nindent 8 }}
diff --git a/helm/amd-gpu/templates/labeller.yaml b/helm/amd-gpu/templates/labeller.yaml
index 4f4fd22b..6e0a2a76 100644
--- a/helm/amd-gpu/templates/labeller.yaml
+++ b/helm/amd-gpu/templates/labeller.yaml
@@ -39,7 +39,7 @@ spec:
       labels:
         name: amdgpu-lr-ds
     spec:
-      {{- if .Values.nfd.enabled }}
+      {{- if .Values.node_selector_enabled }}
       {{- with .Values.node_selector }}
       nodeSelector:
         {{- toYaml . | nindent 8 }}
diff --git a/helm/amd-gpu/values.yaml b/helm/amd-gpu/values.yaml
index 361afafd..ac749eca 100644
--- a/helm/amd-gpu/values.yaml
+++ b/helm/amd-gpu/values.yaml
@@ -31,6 +31,7 @@ tolerations:
   - key: CriticalAddonsOnly
     operator: Exists
 
+node_selector_enabled: false
 node_selector:
   feature.node.kubernetes.io/pci-0300_1002.present: "true"
   kubernetes.io/arch: amd64
-- 
GitLab