-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
return secrets back to original structure but omit them from the conf…
…igmap (#84) Signed-off-by: Mike Mason <[email protected]>
- Loading branch information
Showing
4 changed files
with
53 additions
and
15 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
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{{- define "iam-runtime-infratographer.omit" }} | ||
{{- $subOmit := list }} | ||
{{- range .omit }} | ||
{{- if contains "." . }} | ||
{{- $subkey := splitList "." . | rest | join "." }} | ||
{{- $subOmit = append $subOmit $subkey }} | ||
{{- end}} | ||
{{- end }} | ||
|
||
{{- $result := dict }} | ||
{{- range $key, $val := .source }} | ||
{{- if has $key $.omit }} | ||
{{- /* key is ommited */}} | ||
{{- else if and $subOmit (kindIs "map" $val) }} | ||
{{- $ctx := dict | ||
"source" $val | ||
"omit" $subOmit | ||
"quiet" true | ||
}} | ||
{{- include "iam-runtime-infratographer.omit" $ctx }} | ||
{{- $_ := set $result $key $ctx.source }} | ||
{{- else }} | ||
{{- $_ := set $result $key $val }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{- $_ := set . "source" $result }} | ||
|
||
{{- if not .quiet }} | ||
{{- toYaml $result }} | ||
{{- end }} | ||
{{- end }} |
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