From 963e194d176081ebfe2de4dcdf39818c5a9c79a0 Mon Sep 17 00:00:00 2001 From: Eric Date: Wed, 29 Mar 2023 17:30:24 +0000 Subject: [PATCH 1/4] fix(helm): missing templating for deployment labels --- helm/templates/coder.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/helm/templates/coder.yaml b/helm/templates/coder.yaml index 2896071952c31..f2d28b3bd555e 100644 --- a/helm/templates/coder.yaml +++ b/helm/templates/coder.yaml @@ -15,6 +15,7 @@ metadata: name: coder labels: {{- include "coder.labels" . | nindent 4 }} + {{- toYaml .Values.coder.labels | nindent 4 }} annotations: {{ toYaml .Values.coder.annotations | nindent 4}} spec: replicas: {{ .Values.coder.replicaCount }} From 3ddb47f9cc6b954c5d469f76b93a5d4dff247200 Mon Sep 17 00:00:00 2001 From: Eric Date: Wed, 29 Mar 2023 20:20:32 +0000 Subject: [PATCH 2/4] make: update-golden-files --- helm/templates/coder.yaml | 1 - helm/tests/testdata/default_values.golden | 1 + helm/tests/testdata/tls.golden | 1 + helm/values.yaml | 5 +++-- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/helm/templates/coder.yaml b/helm/templates/coder.yaml index f2d28b3bd555e..f2a842e3ce1ef 100644 --- a/helm/templates/coder.yaml +++ b/helm/templates/coder.yaml @@ -7,7 +7,6 @@ metadata: annotations: {{ toYaml .Values.coder.serviceAccount.annotations | nindent 4 }} labels: {{- include "coder.labels" . | nindent 4 }} - --- apiVersion: apps/v1 kind: Deployment diff --git a/helm/tests/testdata/default_values.golden b/helm/tests/testdata/default_values.golden index e9f92678d4809..1edac4bba7b86 100644 --- a/helm/tests/testdata/default_values.golden +++ b/helm/tests/testdata/default_values.golden @@ -79,6 +79,7 @@ metadata: app.kubernetes.io/part-of: coder app.kubernetes.io/version: "0.1.0" app.kubernetes.io/managed-by: Helm + eric: paulsen annotations: {} spec: diff --git a/helm/tests/testdata/tls.golden b/helm/tests/testdata/tls.golden index 81a5e68f06436..83639f1dd87ea 100644 --- a/helm/tests/testdata/tls.golden +++ b/helm/tests/testdata/tls.golden @@ -83,6 +83,7 @@ metadata: app.kubernetes.io/part-of: coder app.kubernetes.io/version: "0.1.0" app.kubernetes.io/managed-by: Helm + eric: paulsen annotations: {} spec: diff --git a/helm/values.yaml b/helm/values.yaml index f19b228e453fa..81814272647ac 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -13,7 +13,7 @@ coder: # if not set. If you're using the chart directly from git, the default # app version will not work and you'll need to set this value. The helm # chart helpfully fails quickly in this case. - tag: "" + tag: "latest" # coder.image.pullPolicy -- The pull policy to use for the image. See: # https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy pullPolicy: IfNotPresent @@ -40,7 +40,8 @@ coder: # coder.labels -- The Deployment labels. See: # https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ - labels: {} + labels: + eric: paulsen # coder.serviceAccount -- Configuration for the automatically created service # account. Creation of the service account cannot be disabled. From 4d58dd92a3a0d61aea1f9aacecfef063b8f0d7da Mon Sep 17 00:00:00 2001 From: Eric Date: Thu, 30 Mar 2023 13:03:39 +0000 Subject: [PATCH 3/4] rm test label --- helm/values.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/helm/values.yaml b/helm/values.yaml index 81814272647ac..45612a4306279 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -40,8 +40,7 @@ coder: # coder.labels -- The Deployment labels. See: # https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ - labels: - eric: paulsen + labels: {} # coder.serviceAccount -- Configuration for the automatically created service # account. Creation of the service account cannot be disabled. From c6ceb37b94fa6a4fef348b2f899240f851786ae2 Mon Sep 17 00:00:00 2001 From: Dean Sheather Date: Wed, 5 Apr 2023 22:02:34 +0000 Subject: [PATCH 4/4] fixup! Merge branch 'main' into fix-labels --- helm/templates/coder.yaml | 4 +++- helm/tests/testdata/default_values.golden | 1 - helm/tests/testdata/tls.golden | 1 - helm/values.yaml | 10 +++++----- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/helm/templates/coder.yaml b/helm/templates/coder.yaml index f2a842e3ce1ef..6e5874f753acf 100644 --- a/helm/templates/coder.yaml +++ b/helm/templates/coder.yaml @@ -14,7 +14,9 @@ metadata: name: coder labels: {{- include "coder.labels" . | nindent 4 }} - {{- toYaml .Values.coder.labels | nindent 4 }} + {{- with .Values.coder.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} annotations: {{ toYaml .Values.coder.annotations | nindent 4}} spec: replicas: {{ .Values.coder.replicaCount }} diff --git a/helm/tests/testdata/default_values.golden b/helm/tests/testdata/default_values.golden index 1edac4bba7b86..e9f92678d4809 100644 --- a/helm/tests/testdata/default_values.golden +++ b/helm/tests/testdata/default_values.golden @@ -79,7 +79,6 @@ metadata: app.kubernetes.io/part-of: coder app.kubernetes.io/version: "0.1.0" app.kubernetes.io/managed-by: Helm - eric: paulsen annotations: {} spec: diff --git a/helm/tests/testdata/tls.golden b/helm/tests/testdata/tls.golden index 83639f1dd87ea..81a5e68f06436 100644 --- a/helm/tests/testdata/tls.golden +++ b/helm/tests/testdata/tls.golden @@ -83,7 +83,6 @@ metadata: app.kubernetes.io/part-of: coder app.kubernetes.io/version: "0.1.0" app.kubernetes.io/managed-by: Helm - eric: paulsen annotations: {} spec: diff --git a/helm/values.yaml b/helm/values.yaml index 45612a4306279..1d40168e0e7e2 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -13,7 +13,7 @@ coder: # if not set. If you're using the chart directly from git, the default # app version will not work and you'll need to set this value. The helm # chart helpfully fails quickly in this case. - tag: "latest" + tag: "" # coder.image.pullPolicy -- The pull policy to use for the image. See: # https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy pullPolicy: IfNotPresent @@ -34,14 +34,14 @@ coder: # https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ annotations: {} - # coder.podAnnotations -- The Coder pod annotations. See: - # https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ - podAnnotations: {} - # coder.labels -- The Deployment labels. See: # https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ labels: {} + # coder.podAnnotations -- The Coder pod annotations. See: + # https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ + podAnnotations: {} + # coder.serviceAccount -- Configuration for the automatically created service # account. Creation of the service account cannot be disabled. serviceAccount: