Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions base/templates/features/_debug.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@

{{- with $rootContext.Values.debug }}
resources:
configMaps:
dummies:
debug-{{ $chartName }}:
enabled: true
noTemplating: true
data:
values: |
{{ $rootContext.Values | toYaml | nindent 8 }}
Expand Down
4 changes: 2 additions & 2 deletions base/templates/features/_debug_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ templates:
values:
- ../../tests/overallValues.yaml
tests:
- it: debug create configmap
- it: debug create dummy
set:
debug: true
documentSelector:
path: metadata.name
value: RELEASE-NAME-debug-base
asserts:
- isKind:
of: ConfigMap
of: Dummy
- exists:
path: data.values
2 changes: 1 addition & 1 deletion base/templates/features/_workloads_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ tests:
value: RELEASE-NAME-debug-base
asserts:
- isKind:
of: ConfigMap
of: Dummy
- exists:
path: data.workloads.main.istio.dependencies['istio-system/metadata.google.internal']
- equal:
Expand Down
1 change: 1 addition & 0 deletions base/templates/loader/_generate.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,5 @@ Secondary entrypoint and primary loader for the common chart
{{- include "base.lib.resource.renderResources" (dict "rootContext" $ "class" "datadogMetrics") | nindent 0 -}}
{{- include "base.lib.resource.renderResources" (dict "rootContext" $ "class" "requestAuthentications") | nindent 0 -}}
{{- include "base.lib.resource.renderResources" (dict "rootContext" $ "class" "persistentVolumes") | nindent 0 -}}
{{- include "base.lib.resource.renderResources" (dict "rootContext" $ "class" "dummies") | nindent 0 -}}
{{- end -}}
28 changes: 28 additions & 0 deletions base/templates/resources/dummies/_class.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{{- define "base.resources.dummies.class" -}}
{{- $rootContext := .rootContext -}}
{{- $object := .object -}}

{{- $labels := merge
($object.labels | default dict)
(include "base.lib.metadata.allLabels" (dict "rootContext" $rootContext "identifier" $object.identifier ) | fromYaml)
-}}
{{- $annotations := merge
($object.annotations | default dict)
(include "base.lib.metadata.globalAnnotations" $rootContext | fromYaml)
-}}
---
apiVersion: v1
kind: Dummy
metadata:
name: {{ $object.name }}
{{- with $labels }}
labels: {{- toYaml . | nindent 4 -}}
{{- end }}
{{- with $annotations }}
annotations: {{- toYaml . | nindent 4 -}}
{{- end }}
data:
{{- with $object.data }}
{{- toYaml . | nindent 2 }}
{{- end }}
{{- end -}}
12 changes: 12 additions & 0 deletions base/templates/resources/dummies/_getByIdentifier.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{/*
Return a configMap Object by its Identifier.
*/}}
{{- define "base.resources.dummies.getByIdentifier" -}}
{{- $rootContext := .rootContext -}}
{{- $identifier := .id -}}

{{- $configMapValues := dig "configMaps" $identifier nil $rootContext.Values.resources -}}
{{- if not (empty $configMapValues) -}}
{{- include "base.resources.configMaps.valuesToObject" (dict "rootContext" $rootContext "id" $identifier "values" $configMapValues) -}}
{{- end -}}
{{- end -}}
7 changes: 7 additions & 0 deletions base/templates/resources/dummies/_validate.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{{/*
Validate configMap values
*/}}
{{- define "base.resources.dummies.validate" -}}
{{- $rootContext := .rootContext -}}
{{- $configMapValues := .object -}}
{{- end -}}
7 changes: 7 additions & 0 deletions base/templates/resources/dummies/_valuesToObject.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{{/*
Convert configMap values to an object
*/}}
{{- define "base.resources.dummies.valuesToObject" -}}
{{- include "base.lib.resource.defaultValuesToObject" . -}}
{{- .values | toYaml -}}
{{- end -}}