-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[manifests]: Content Rendering Functions (#50)
* Release Crowd Helm Chart Signed-off-by: Oliver Bähler <[email protected]> * Add Sonatype Chart Signed-off-by: Oliver Bähler <[email protected]> * Add license Signed-off-by: Oliver Bähler <[email protected]> * Content Templates Signed-off-by: Oliver Bähler <[email protected]> * Helm-Docs Signed-off-by: Oliver Bähler <[email protected]>
- Loading branch information
1 parent
a65cf19
commit 0edf057
Showing
4 changed files
with
255 additions
and
3 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
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,44 @@ | ||
/* | ||
|
||
Copyright © 2021 Bedag Informatik AG | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
|
||
*/ | ||
{{/* | ||
Sprig Template - File | ||
*/}} | ||
{{- define "bedag-lib.utils.configs.file" -}} | ||
{{- $config := (required "Configuration reference requried" $.config) -}} | ||
{{- default (default "config.yml" .name) $config.name | nindent 0 }}: |- {{- include "bedag-lib.utils.configs.content" $ | nindent 2 }} | ||
{{- end -}} | ||
|
||
|
||
{{/* | ||
Sprig Template - Content | ||
*/}} | ||
{{- define "bedag-lib.utils.configs.content" -}} | ||
{{- $c := (required "Context required" $.context) -}} | ||
{{- $config := (required "Configuration reference requried" $.config) -}} | ||
{{- if $config.content -}} | ||
{{- $format := (default $.format $config.format) -}} | ||
{{- if and $format (kindIs "map" $config.content) }} | ||
{{- range $key, $value := $config.content }} | ||
{{- $scope := (dict "key" $key "value" $value) -}} | ||
{{- include "lib.utils.strings.template" (dict "value" $format "context" $c "extraValuesKey" "loop" "extraValues" $scope) | nindent 0 }} | ||
{{- end }} | ||
{{- else }} | ||
{{- include "lib.utils.strings.template" (dict "value" $config.content "context" $c) | nindent 0 }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end -}} |