forked from helm/charts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[stable/spinnaker] Move default profile settings from values to the t…
…emplate (helm#13918) * [stable/spinnaker] Move default profile settings from values to the template Add support of passing actual blocks (aka `map[string]interface{}`) to `halyard.additionalProfileConfigMaps.data`, which allows to override any of the default field as blocks are deeply merged. These changes also keep the full backward compatibility with the old way passing data to `halyard.additionalProfileConfigMaps.data`. Users can still pass the string values there and they will be applied only if `halyard.additionalProfileConfigMaps.create` is set to `true`. Also, `halyard.additionalProfileConfigMaps.create` has been removed from the default values because now this ConfigMap will always be created. Signed-off-by: Mikhail Zholobov <legal90@gmail.com> * [stable/spinnaker] Disable S3 versioning if Minio is enabled Minio doesn't support versioning, so we should disable it on the Front50 side in this case. https://www.spinnaker.io/setup/install/storage/minio/#editing-your-storage-settings Otherwise, "pull-charts-e2e" tests will always fail because of Front50 errors related to the versioning on S3-like storage backend. Signed-off-by: Mikhail Zholobov <legal90@gmail.com> * [stable/spinnaker] Bump chart version Signed-off-by: Mikhail Zholobov <legal90@gmail.com>
- Loading branch information
Showing
5 changed files
with
54 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 39 additions & 8 deletions
47
stable/spinnaker/templates/configmap/additional-profile-configmaps.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,46 @@ | ||
{{ if .Values.halyard.additionalProfileConfigMaps.create -}} | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ template "spinnaker.fullname" . }}-additional-profile-config-maps | ||
labels: | ||
{{ include "spinnaker.standard-labels" . | indent 4 }} | ||
{{/* | ||
Render profiles for each service by merging predefined defaults with values passed by | ||
.Values.halyard.additionalProfileConfigMaps.data | ||
*/}} | ||
{{- $profiles := dict "gate-local.yml" "" -}} | ||
|
||
{{- /* Defaults: Disable S3 versioning on Front50 if Minio storage is used */}} | ||
{{- /* https://www.spinnaker.io/setup/install/storage/minio/#editing-your-storage-settings */}} | ||
{{- if .Values.minio.enabled -}} | ||
{{- $_ := set $profiles "front50-local.yml" (dict "spinnaker" (dict "s3" (dict "versioning" false))) -}} | ||
{{- end -}} | ||
|
||
{{- /* Defaults: Add special settings for gate if GCE or ALB ingress is used */}} | ||
{{- /* https://github.com/spinnaker/spinnaker/issues/1630#issuecomment-467359999 */}} | ||
{{- if index $.Values.ingress "annotations" -}} | ||
{{- if eq (index $.Values.ingress.annotations "kubernetes.io/ingress.class" | default "") "gce" "alb" }} | ||
{{- $tomcatProxySettings := dict -}} | ||
{{- $_ := set $tomcatProxySettings "protocolHeader" "X-Forwarded-Proto" -}} | ||
{{- $_ := set $tomcatProxySettings "remoteIpHeader" "X-Forwarded-For" -}} | ||
{{- $_ := set $tomcatProxySettings "internalProxies" ".*" -}} | ||
{{- $_ := set $tomcatProxySettings "httpsServerPort" "X-Forwarded-Port" -}} | ||
{{- $_ := set $profiles "gate-local.yml" (dict "server" (dict "tomcat" $tomcatProxySettings)) -}} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{- /* Merge dictionaries with passed values */}} | ||
{{- $customProfilesEnabled := .Values.halyard.additionalProfileConfigMaps.create | default true -}} | ||
{{- if and $customProfilesEnabled .Values.halyard.additionalProfileConfigMaps.data -}} | ||
{{- $_ := mergeOverwrite $profiles .Values.halyard.additionalProfileConfigMaps.data -}} | ||
{{- end -}} | ||
|
||
{{- /* Convert the content of profiles to string unless it's already a string */}} | ||
{{- range $filename, $content := $profiles -}} | ||
{{- if not (typeIs "string" $content) -}} | ||
{{- $_ := set $profiles $filename ($content | toYaml) -}} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
data: | ||
{{- if and .Values.halyard.additionalProfileConfigMaps.create .Values.halyard.additionalProfileConfigMaps.data }} | ||
{{- range $index, $content := .Values.halyard.additionalProfileConfigMaps.data }} | ||
{{ $index }}: |- | ||
{{ $content | indent 4 }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
{{ $profiles | toYaml | indent 2 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters