Skip to content

Commit 75ba4b7

Browse files
committed
Force basicAuth secrets to always be release scoped
Secret generation should not be shared between releases as that violates general Helm practices. As the configmap can potentially be shared, we need to ensure the resource-policy keep annotation appears when it is the non-release scoped variant. Signed-off-by: Jeremy Ho <jujaga@gmail.com>
1 parent 019d34a commit 75ba4b7

File tree

3 files changed

+3
-8
lines changed

3 files changed

+3
-8
lines changed

charts/coms/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: common-object-management-service
33
# This is the chart version. This version number should be incremented each time you make changes
44
# to the chart and its templates, including the app version.
55
# Versions are expected to follow Semantic Versioning (https://semver.org/)
6-
version: 0.0.3
6+
version: 0.0.4
77
kubeVersion: ">= 1.13.0"
88
description: A microservice for managing access control to S3 Objects
99
# A chart can be either an 'application' or a 'library' chart.

charts/coms/templates/configmap.yaml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,9 @@ apiVersion: v1
44
kind: ConfigMap
55
metadata:
66
name: {{ include "coms.configname" . }}-config
7-
labels:
8-
{{- include "coms.labels" . | nindent 4 }}
9-
{{- with .Values.route.annotations }}
7+
{{- if not .Values.config.releaseScoped }}
108
annotations:
11-
{{- if not .Values.config.releaseScoped }}
129
"helm.sh/resource-policy": keep
13-
{{- end }}
14-
{{- toYaml . | nindent 4 }}
1510
{{- end }}
1611
data: {{ toYaml .Values.config.configMap | nindent 2 }}
1712
{{- end }}

charts/coms/templates/secret.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{{- $password := (randAlphaNum 32) | b64enc }}
22
{{- $username := (randAlphaNum 32) | b64enc }}
33

4-
{{- $secretName := printf "%s-%s" (include "coms.configname" .) "basicauth" }}
4+
{{- $secretName := printf "%s-%s" (include "coms.fullname" .) "basicauth" }}
55
{{- $secret := (lookup "v1" "Secret" .Release.Namespace $secretName ) }}
66
{{- if not $secret }}
77
---

0 commit comments

Comments
 (0)