UNCLASSIFIED - NO CUI

Skip to content
Snippets Groups Projects

Enhance Gitlab sso CA Value Support 1170

Merged Anthony Fresta requested to merge enhance-sso-ca-1170 into master
All threads resolved!
2 files
+ 26
36
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -8,38 +8,5 @@ metadata:
type: Opaque
data:
ca.pem: {{ .Values.sso.certificate_authority | b64enc }}
global:
certificates:
customCAs:
# - secret: {{ .Values.global.certificates.customCAs }}
{{- end }}
{{- /* This function merges defaults in lists from above into overlays */ -}}
{{- /* The end user will not have to replicate exclusions/repos from above when providing an overlay */ -}}
{{- /* There is a hidden flag `skipOverlayMerge` that can be added to any constraint to ignore the defaults */ -}}
{{- define "global.certificates.customCAs" }}
{{- $defaults := fromYaml (include "bigbang.defaults.gitlab" .) }}
{{- $overlays := dig "values" dict .Values.gitlab }}
{{- range $constraint, $default := $defaults.violations }}
{{- $overlay := (dig "violations" $constraint dict $overlays) }}
# Only continue if an overlay matches a default constriant and hidden "skipOverlayMerge" is not set
{{- if and $overlay (not $overlay.skipOverlayMerge) }}
# Add any default excludedNamespaces to overlay
{{- if and (dig "match" "excludedNamespaces" list $default) (dig "match" "excludedNamespaces" list $overlay) }}
{{ $_ := set $overlay.match "excludedNamespaces" (concat $default.match.excludedNamespaces $overlay.match.excludedNamespaces) }}
{{- end }}
# Add any default excludedResources to overlay
{{- if and (dig "parameters" "excludedResources" list $default) (dig "parameters" "excludedResources" list $overlay) }}
{{ $_ := set $overlay.parameters "excludedResources" (concat $default.parameters.excludedResources $overlay.parameters.excludedResources) }}
{{- end }}
# Special case to add registries for allowed registries to overlay
{{- if and (dig "parameters" "repos" list $default) (dig "parameters" "repos" list $overlay) }}
{{ $_ := set $overlay.parameters "repos" (concat $default.parameters.repos $overlay.parameters.repos) }}
{{- end }}
{{- end }}
{{- end }}
{{ toYaml $overlays }}
{{- end }}
Loading