You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by ho...@apache.org on 2022/11/07 17:42:47 UTC

[solr-operator] branch main updated: Add Annotations to created ServiceAccount (#480)

This is an automated email from the ASF dual-hosted git repository.

houston pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr-operator.git


The following commit(s) were added to refs/heads/main by this push:
     new 4052556  Add Annotations to created ServiceAccount (#480)
4052556 is described below

commit 405255685840069a631bc4176035d76a1ad5315a
Author: Nick Huanca <ni...@gmail.com>
AuthorDate: Mon Nov 7 10:42:41 2022 -0700

    Add Annotations to created ServiceAccount (#480)
---
 helm/solr-operator/Chart.yaml                     |  5 +++++
 helm/solr-operator/templates/service_account.yaml |  8 +++++++-
 helm/solr-operator/values.yaml                    |  3 +++
 helm/solr/Chart.yaml                              | 11 +++--------
 helm/solr/templates/service_account.yaml          |  6 ++++++
 helm/solr/values.yaml                             |  3 +++
 6 files changed, 27 insertions(+), 9 deletions(-)

diff --git a/helm/solr-operator/Chart.yaml b/helm/solr-operator/Chart.yaml
index 8446dc9..55a9982 100644
--- a/helm/solr-operator/Chart.yaml
+++ b/helm/solr-operator/Chart.yaml
@@ -60,6 +60,11 @@ annotations:
           url: https://github.com/apache/solr-operator/issues/479
         - name: Github PR
           url: https://github.com/apache/solr-operator/pull/481
+    - kind: added
+      description: Support custom annotations on created ServiceAccount
+      links:
+        - name: GitHub PR
+          url: https://github.com/apache/solr-operator/pull/480
   artifacthub.io/images: |
     - name: solr-operator
       image: apache/solr-operator:v0.7.0-prerelease
diff --git a/helm/solr-operator/templates/service_account.yaml b/helm/solr-operator/templates/service_account.yaml
index 38003ff..65aefc8 100644
--- a/helm/solr-operator/templates/service_account.yaml
+++ b/helm/solr-operator/templates/service_account.yaml
@@ -17,5 +17,11 @@
 apiVersion: v1
 kind: ServiceAccount
 metadata:
+  {{- if .Values.serviceAccount.annotations }}
+  annotations:
+    {{- range $key, $value := .Values.serviceAccount.annotations }}
+    {{ $key | quote }}: {{ $value | quote }}
+    {{- end }}
+  {{- end }}
   name: {{ include "solr-operator.serviceAccountName" . }}
-{{- end }}
\ No newline at end of file
+{{- end }}
diff --git a/helm/solr-operator/values.yaml b/helm/solr-operator/values.yaml
index 92ce1b2..dc88cab 100644
--- a/helm/solr-operator/values.yaml
+++ b/helm/solr-operator/values.yaml
@@ -62,6 +62,9 @@ serviceAccount:
   # If not set and create is true, a name is generated using the fullname template
   name: ""
 
+  ## Annotations to be added to ServiceAccount
+  annotations: {}
+
 # Various Pod Options to customize the runtime of the operator
 resources: {}
 envVars: []
diff --git a/helm/solr/Chart.yaml b/helm/solr/Chart.yaml
index 17695af..64a86bf 100644
--- a/helm/solr/Chart.yaml
+++ b/helm/solr/Chart.yaml
@@ -40,15 +40,10 @@ annotations:
   # Allowed syntax is described at: https://artifacthub.io/docs/topics/annotations/helm/#example
   artifacthub.io/changes: |
     - kind: added
-      description: Addition 1
+      description: Support custom annotations on created ServiceAccount
       links:
-        - name: Github Issue
-          url: https://github.com/issue-url
-    - kind: changed
-      description: Change 2
-      links:
-        - name: Github PR
-          url: https://github.com/pr-url
+        - name: GitHub PR
+          url: https://github.com/apache/solr-operator/pull/480
   artifacthub.io/containsSecurityUpdates: "false"
   artifacthub.io/recommendations: |
     - url: https://artifacthub.io/packages/helm/apache-solr/solr-operator
diff --git a/helm/solr/templates/service_account.yaml b/helm/solr/templates/service_account.yaml
index ed035d1..b3ea841 100644
--- a/helm/solr/templates/service_account.yaml
+++ b/helm/solr/templates/service_account.yaml
@@ -17,5 +17,11 @@
 apiVersion: v1
 kind: ServiceAccount
 metadata:
+  {{- if .Values.serviceAccount.annotations }}
+  annotations:
+    {{- range $key, $value := .Values.serviceAccount.annotations }}
+    {{ $key | quote }}: {{ $value | quote }}
+    {{- end }}
+  {{- end }}
   name: {{ include "solr.serviceAccountName.global" . }}
 {{- end }}
diff --git a/helm/solr/values.yaml b/helm/solr/values.yaml
index 1c1f1d3..d61dad2 100644
--- a/helm/solr/values.yaml
+++ b/helm/solr/values.yaml
@@ -36,6 +36,9 @@ serviceAccount:
   # If not set and create is true, a name is generated using the fullname template
   name: ""
 
+  ## Annotations to be added to ServiceAccount
+  annotations: {}
+
 image:
   repository: "solr"
   tag: ""