diff --git a/helm/coder/tests/testdata/sa.golden b/helm/coder/tests/testdata/sa.golden index ff423c318b..e4d49385fc 100644 --- a/helm/coder/tests/testdata/sa.golden +++ b/helm/coder/tests/testdata/sa.golden @@ -11,6 +11,7 @@ metadata: app.kubernetes.io/name: coder app.kubernetes.io/part-of: coder app.kubernetes.io/version: 0.1.0 + com.coder/sa-label: test-value helm.sh/chart: coder-0.1.0 name: coder-service-account namespace: default diff --git a/helm/coder/tests/testdata/sa.yaml b/helm/coder/tests/testdata/sa.yaml index 4e0c98c223..6fcb1bbd6b 100644 --- a/helm/coder/tests/testdata/sa.yaml +++ b/helm/coder/tests/testdata/sa.yaml @@ -5,4 +5,6 @@ coder: name: coder-service-account annotations: eks.amazonaws.com/role-arn: arn:aws:iam::123456789012:role/coder-service-account + labels: + com.coder/sa-label: test-value workspacePerms: true diff --git a/helm/coder/tests/testdata/sa_coder.golden b/helm/coder/tests/testdata/sa_coder.golden index 8725a6724e..1567368093 100644 --- a/helm/coder/tests/testdata/sa_coder.golden +++ b/helm/coder/tests/testdata/sa_coder.golden @@ -11,6 +11,7 @@ metadata: app.kubernetes.io/name: coder app.kubernetes.io/part-of: coder app.kubernetes.io/version: 0.1.0 + com.coder/sa-label: test-value helm.sh/chart: coder-0.1.0 name: coder-service-account namespace: coder diff --git a/helm/coder/values.yaml b/helm/coder/values.yaml index 85a4e4519f..1c663f6a1c 100644 --- a/helm/coder/values.yaml +++ b/helm/coder/values.yaml @@ -130,6 +130,8 @@ coder: # coder.serviceAccount.annotations -- The Coder service account annotations. annotations: {} + # coder.serviceAccount.labels -- The Coder service account labels. + labels: {} # coder.serviceAccount.name -- The service account name name: coder # coder.serviceAccount.disableCreate -- Whether to create the service account or use existing service account. diff --git a/helm/libcoder/templates/_coder.yaml b/helm/libcoder/templates/_coder.yaml index 52caaf5891..ad7a25cdb1 100644 --- a/helm/libcoder/templates/_coder.yaml +++ b/helm/libcoder/templates/_coder.yaml @@ -101,6 +101,9 @@ metadata: annotations: {{ toYaml .Values.coder.serviceAccount.annotations | nindent 4 }} labels: {{- include "coder.labels" . | nindent 4 }} + {{- with .Values.coder.serviceAccount.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} {{- end -}} {{- define "libcoder.serviceaccount" -}} {{- include "libcoder.util.merge" (append . "libcoder.serviceaccount.tpl") -}}