From 457e7fef039882b02071cc76481724219d7df054 Mon Sep 17 00:00:00 2001 From: Siddharth Deshmukh Date: Tue, 24 Sep 2024 16:08:32 +0200 Subject: [PATCH] Service accounts additional labels (#78) * feat(workerpool-controller): Support additional labels in workerpool controller service account. * feat(vcs-agent): Support additional labels in vcs-agent service account. --------- Co-authored-by: siddharth.deshmukh2 --- spacelift-workerpool-controller/Chart.yaml | 2 +- spacelift-workerpool-controller/templates/serviceaccount.yaml | 3 +++ spacelift-workerpool-controller/values.yaml | 1 + vcs-agent/Chart.yaml | 2 +- vcs-agent/templates/serviceaccount.yaml | 3 +++ vcs-agent/values.yaml | 2 ++ 6 files changed, 11 insertions(+), 2 deletions(-) diff --git a/spacelift-workerpool-controller/Chart.yaml b/spacelift-workerpool-controller/Chart.yaml index 42a227f..0c1dbda 100644 --- a/spacelift-workerpool-controller/Chart.yaml +++ b/spacelift-workerpool-controller/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: spacelift-workerpool-controller description: A Helm chart for deploying spacelift workerpool controller type: application -version: 0.1.0 +version: 0.2.0 appVersion: "v0.0.13" dependencies: diff --git a/spacelift-workerpool-controller/templates/serviceaccount.yaml b/spacelift-workerpool-controller/templates/serviceaccount.yaml index df5dc95..385a008 100644 --- a/spacelift-workerpool-controller/templates/serviceaccount.yaml +++ b/spacelift-workerpool-controller/templates/serviceaccount.yaml @@ -7,5 +7,8 @@ metadata: app.kubernetes.io/created-by: spacelift-workerpool-controller app.kubernetes.io/part-of: spacelift-workerpool-controller {{- include "spacelift-workerpool-controller.labels" . | nindent 4 }} + {{- with .Values.controllerManager.serviceAccount.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} annotations: {{- toYaml .Values.controllerManager.serviceAccount.annotations | nindent 4 }} \ No newline at end of file diff --git a/spacelift-workerpool-controller/values.yaml b/spacelift-workerpool-controller/values.yaml index 8ec6159..7f0fa35 100644 --- a/spacelift-workerpool-controller/values.yaml +++ b/spacelift-workerpool-controller/values.yaml @@ -53,6 +53,7 @@ controllerManager: podAnnotations: {} serviceAccount: annotations: {} + labels: {} nodeSelector: {} tolerations: [] topologySpreadConstraints: [] diff --git a/vcs-agent/Chart.yaml b/vcs-agent/Chart.yaml index 12a1b33..97a230e 100644 --- a/vcs-agent/Chart.yaml +++ b/vcs-agent/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: vcs-agent description: A Helm chart for deploying Spacelift VCS Agent type: application -version: 0.1.0 +version: 0.2.0 # The appVersion is the version of the VCS Agent binary. Since the chart is currently configured # to always use the latest version, this is set to "latest". diff --git a/vcs-agent/templates/serviceaccount.yaml b/vcs-agent/templates/serviceaccount.yaml index 8845bb8..be9554d 100644 --- a/vcs-agent/templates/serviceaccount.yaml +++ b/vcs-agent/templates/serviceaccount.yaml @@ -5,6 +5,9 @@ metadata: name: {{ include "vcs-agent.serviceAccountName" . }} labels: {{- include "vcs-agent.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} {{- with .Values.serviceAccount.annotations }} annotations: {{- toYaml . | nindent 4 }} diff --git a/vcs-agent/values.yaml b/vcs-agent/values.yaml index d5f1c72..a803cf9 100644 --- a/vcs-agent/values.yaml +++ b/vcs-agent/values.yaml @@ -34,6 +34,8 @@ serviceAccount: # The name of the service account to use. # If not set and create is true, a name is generated using the fullname template name: "" + # Labels to add to the service account + labels: {} vcsagent: extraEnv: []