Skip to content

Commit

Permalink
feat: ConfigMaps enhancement
Browse files Browse the repository at this point in the history
  • Loading branch information
artemdanielyan committed Mar 27, 2024
1 parent b8ec3dc commit 613ca65
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.idea/
tmp/
test*.yml
private/
private/
values-test.yaml
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# Changelog
## 2.6.0 - March 15, 2024
* feature: Better rendering for ConfigMap resources, added support for b64 encoded strings for easier setting of values via CLI.
* feature: Support for certmanager custom resources ([#48](https://github.com/nixys/nxs-universal-chart/issues/48))
* feature: Support loadBalancerClass, allocateLoadBalancerNodePorts and externalTrafficPolicy for LoadBalancer type services ([#63](https://github.com/nixys/nxs-universal-chart/issues/63))
* fix: PVC name rendering ([#64](https://github.com/nixys/nxs-universal-chart/issues/64))
* TODO: Add readme to new resources

## 2.5.1 - January 10, 2024
* feature: add priorityClassName as option for every workload
Expand Down
2 changes: 1 addition & 1 deletion Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
description: Nixys universal Helm chart for deploy your apps to Kubernetes
name: universal-chart
version: 2.5.1
version: 2.6.0
maintainers:
- name: Roman Andreev
email: r.andreev@nixys.ru
Expand Down
2 changes: 1 addition & 1 deletion templates/configmap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ metadata:
{{- include "helpers.app.hooksAnnotations" $ | nindent 4 }}
{{- with $val.annotations }}{{- include "helpers.tplvalues.render" (dict "value" . "context" $) | nindent 4 }}{{ end }}
data:
{{- include "helpers.tplvalues.render" ( dict "value" $val.data "context" $ ) | nindent 2 }}
{{- include "helpers.configmaps.renderConfigMap" ( dict "value" $val.data "context" $ ) | nindent 2 }}
{{- end -}}
{{- end -}}
9 changes: 7 additions & 2 deletions templates/helpers/_configmaps.tpl
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
{{- define "helpers.configmaps.decode" -}}
{{if hasPrefix "b64:" .value}}{{trimPrefix "b64:" .value | b64dec | quote }}{{else}}{{ quote .value }}{{- end }}
{{- end -}}


{{- define "helpers.configmaps.renderConfigMap" -}}
{{- $v := dict -}}
{{- if typeIs "string" .value -}}
Expand All @@ -7,11 +12,11 @@
{{- end -}}
{{- range $key, $value := $v }}
{{- if eq (typeOf $value) "float64" }}
{{ printf "%s: %s" $key (toString $value | quote) }}
{{ printf "%s: %s" $key (include "helpers.configmaps.decode" (dict "value" $value)) }}
{{- else if empty $value }}
{{ printf "%s: %s" $key ("" | quote) }}
{{- else if kindIs "string" $value }}
{{ printf "%s: %s" $key ($value | quote) }}
{{ printf "%s: %s" $key (include "helpers.configmaps.decode" (dict "value" $value)) }}
{{- else }}
{{ $key }}: {{$value | toJson | quote }}
{{- end -}}
Expand Down
2 changes: 1 addition & 1 deletion templates/helpers/_deprecations.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
We are currently changing name of our chart from universal-chart to nxs-universal-chart.

Prior to release of 3.0 both versions will be supported.
{{- end }}
{{ end }}

{{- define "helpers.deprecation.notice" -}}
** NOTICE **
Expand Down

0 comments on commit 613ca65

Please sign in to comment.