Skip to content

Commit 49e6b48

Browse files
authored
feat(annotations): add secret annotations (#458)
* feat(annotations): add secret annotations Allow adding annotations to secret resources. Signed-off-by: Alexander Chebotov <[email protected]>
1 parent e08a424 commit 49e6b48

File tree

12 files changed

+73
-11
lines changed

12 files changed

+73
-11
lines changed

charts/atlantis/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: v1
33
appVersion: v0.33.0
44
description: A Helm chart for Atlantis https://www.runatlantis.io
55
name: atlantis
6-
version: 5.14.0
6+
version: 5.15.0
77
keywords:
88
- terraform
99
home: https://www.runatlantis.io

charts/atlantis/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ extraManifests:
104104
| environment | object | `{}` | Environment values to add to the Atlantis pod. Check values.yaml for examples. |
105105
| environmentRaw | list | `[]` | Optionally specify additional environment variables in raw yaml format. Useful to specify variables refering to k8s objects. Check values.yaml for examples. |
106106
| environmentSecrets | list | `[]` | Optionally specify additional environment variables to be populated from Kubernetes secrets. Useful for passing in TF_VAR_foo or other secret environment variables from Kubernetes secrets. Check values.yaml for examples. |
107-
| extraAnnotations | object | `{}` | |
107+
| extraAnnotations | object | `{}` | These annotations will be added to all the resources. Check values.yaml for examples. |
108108
| extraArgs | list | `[]` | Optionally specify extra arguments for the Atlantis pod. Check values.yaml for examples. |
109109
| extraContainers | list | `[]` | Optionally specify extra containers for the Atlantis pod. Check values.yaml for examples. |
110110
| extraManifests | list | `[]` | Optionally specify additional manifests to be created. Check values.yaml for examples. |
@@ -183,6 +183,7 @@ extraManifests:
183183
| replicaCount | int | `1` | Replica count for Atlantis pods. |
184184
| repoConfig | string | `""` | Use Server Side Repo Config, ref: https://www.runatlantis.io/docs/server-side-repo-config.html. Check values.yaml for examples. |
185185
| resources | object | `{}` | Resources for Atlantis. Check values.yaml for examples. |
186+
| secret.annotations | object | `{}` | Annotations for the Secrets. Check values.yaml for examples. |
186187
| service.annotations | object | `{}` | |
187188
| service.externalTrafficPolicy | string | `nil` | |
188189
| service.loadBalancerIP | string | `nil` | |

charts/atlantis/templates/secret-api.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,14 @@ metadata:
66
namespace: {{ .Release.Namespace }}
77
labels:
88
{{- include "atlantis.labels" . | nindent 4 }}
9-
{{- with .Values.extraAnnotations }}
9+
{{- if or .Values.secret.annotations .Values.extraAnnotations }}
1010
annotations:
11+
{{- with .Values.secret.annotations }}
1112
{{- toYaml . | nindent 4 }}
13+
{{- end }}
14+
{{- with .Values.extraAnnotations }}
15+
{{- toYaml . | nindent 4 }}
16+
{{- end }}
1217
{{- end }}
1318
data:
1419
apisecret: {{ .Values.api.secret | b64enc }}

charts/atlantis/templates/secret-aws.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,14 @@ metadata:
66
namespace: {{ .Release.Namespace }}
77
labels:
88
{{- include "atlantis.labels" . | nindent 4 }}
9-
{{- with .Values.extraAnnotations }}
9+
{{- if or .Values.secret.annotations .Values.extraAnnotations }}
1010
annotations:
11+
{{- with .Values.secret.annotations }}
1112
{{- toYaml . | nindent 4 }}
13+
{{- end }}
14+
{{- with .Values.extraAnnotations }}
15+
{{- toYaml . | nindent 4 }}
16+
{{- end }}
1217
{{- end }}
1318
data:
1419
{{- if .Values.aws.credentials }}

charts/atlantis/templates/secret-basic-auth.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,14 @@ metadata:
66
namespace: {{ .Release.Namespace }}
77
labels:
88
{{- include "atlantis.labels" . | nindent 4 }}
9-
{{- with .Values.extraAnnotations }}
9+
{{- if or .Values.secret.annotations .Values.extraAnnotations }}
1010
annotations:
11+
{{- with .Values.secret.annotations }}
1112
{{- toYaml . | nindent 4 }}
13+
{{- end }}
14+
{{- with .Values.extraAnnotations }}
15+
{{- toYaml . | nindent 4 }}
16+
{{- end }}
1217
{{- end }}
1318
data:
1419
username: {{ .Values.basicAuth.username | b64enc }}

charts/atlantis/templates/secret-gitconfig.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,14 @@ metadata:
66
namespace: {{ .Release.Namespace }}
77
labels:
88
{{- include "atlantis.labels" . | nindent 4 }}
9-
{{- with .Values.extraAnnotations }}
9+
{{- if or .Values.secret.annotations .Values.extraAnnotations }}
1010
annotations:
11+
{{- with .Values.secret.annotations }}
1112
{{- toYaml . | nindent 4 }}
13+
{{- end }}
14+
{{- with .Values.extraAnnotations }}
15+
{{- toYaml . | nindent 4 }}
16+
{{- end }}
1217
{{- end }}
1318
data:
1419
gitconfig: {{ .Values.gitconfig | b64enc }}

charts/atlantis/templates/secret-netrc.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,14 @@ metadata:
66
namespace: {{ .Release.Namespace }}
77
labels:
88
{{- include "atlantis.labels" . | nindent 4 }}
9-
{{- with .Values.extraAnnotations }}
9+
{{- if or .Values.secret.annotations .Values.extraAnnotations }}
1010
annotations:
11+
{{- with .Values.secret.annotations }}
1112
{{- toYaml . | nindent 4 }}
13+
{{- end }}
14+
{{- with .Values.extraAnnotations }}
15+
{{- toYaml . | nindent 4 }}
16+
{{- end }}
1217
{{- end }}
1318
data:
1419
netrc: {{ .Values.netrc | b64enc }}

charts/atlantis/templates/secret-redis.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,14 @@ metadata:
66
namespace: {{ .Release.Namespace }}
77
labels:
88
{{- include "atlantis.labels" . | nindent 4 }}
9-
{{- with .Values.extraAnnotations }}
9+
{{- if or .Values.secret.annotations .Values.extraAnnotations }}
1010
annotations:
11+
{{- with .Values.secret.annotations }}
1112
{{- toYaml . | nindent 4 }}
13+
{{- end }}
14+
{{- with .Values.extraAnnotations }}
15+
{{- toYaml . | nindent 4 }}
16+
{{- end }}
1217
{{- end }}
1318
data:
1419
password: {{ .Values.redis.password | b64enc }}

charts/atlantis/templates/secret-service-account.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,14 @@ metadata:
88
labels:
99
component: service-account-secret
1010
{{- include "atlantis.labels" $ | nindent 4 }}
11-
{{- with $.Values.extraAnnotations }}
11+
{{- if or $.Values.secret.annotations $.Values.extraAnnotations }}
1212
annotations:
13+
{{- with $.Values.secret.annotations }}
1314
{{- toYaml . | nindent 4 }}
15+
{{- end }}
16+
{{- with $.Values.extraAnnotations }}
17+
{{- toYaml . | nindent 4 }}
18+
{{- end }}
1419
{{- end }}
1520
data:
1621
service-account.json: {{ $secret }}

charts/atlantis/templates/secret-webhook.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,14 @@ metadata:
66
namespace: {{ .Release.Namespace }}
77
labels:
88
{{- include "atlantis.labels" . | nindent 4 }}
9-
{{- with .Values.extraAnnotations }}
9+
{{- if or .Values.secret.annotations .Values.extraAnnotations }}
1010
annotations:
11+
{{- with .Values.secret.annotations }}
1112
{{- toYaml . | nindent 4 }}
13+
{{- end }}
14+
{{- with .Values.extraAnnotations }}
15+
{{- toYaml . | nindent 4 }}
16+
{{- end }}
1217
{{- end }}
1318
data:
1419
{{- if .Values.githubApp }}

0 commit comments

Comments
 (0)