Skip to content

Commit

Permalink
Merge pull request #53 from nixys/feat/fixes
Browse files Browse the repository at this point in the history
2.4.1 fixes
  • Loading branch information
artemdanielyan committed Aug 23, 2023
2 parents 72b19a5 + 309a5a5 commit c897f1d
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 16 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 2.4.1 - August 23, 2023
* fix: render serviceaccount names
* fix: merging env if both general and container envs are used ([#50](https://github.com/nixys/nxs-universal-chart/issues/50))
* fix: deploymentsGeneral.annotation applying to deployment ([#49](https://github.com/nixys/nxs-universal-chart/issues/49))


## 2.4.0 - July 21, 2023
* feature: add Service Account workload to create serviceaccount and coresponding roles/clusterroles with bindings
* fix: default container and init-container names
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.4.0
version: 2.4.1
maintainers:
- name: Roman Andreev
email: r.andreev@nixys.ru
Expand Down
1 change: 1 addition & 0 deletions templates/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ metadata:
{{- with .labels }}{{- include "helpers.tplvalues.render" (dict "value" . "context" $) | nindent 4 }}{{- end }}
annotations:
{{- include "helpers.app.genericAnnotations" $ | indent 4 }}
{{- with $general.annotations }}{{- include "helpers.tplvalues.render" (dict "value" . "context" $) | nindent 4 }}{{- end }}
{{- with .annotations }}{{- include "helpers.tplvalues.render" (dict "value" . "context" $) | nindent 4 }}{{- end }}
spec:
replicas: {{ .replicas | default 1 }}
Expand Down
4 changes: 2 additions & 2 deletions templates/helpers/_pod.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
{{- $name := .name -}}
{{- with .value -}}
{{- if .serviceAccountName }}
serviceAccountName: {{ .serviceAccountName }}
serviceAccountName: {{- include "helpers.tplvalues.render" (dict "value" .serviceAccountName "context" $) | nindent 2 }}
{{- else if $.Values.generic.serviceAccountName }}
serviceAccountName: {{ $.Values.generic.serviceAccountName }}
serviceAccountName: {{- include "helpers.tplvalues.render" (dict "value" $.Values.generic.serviceAccountName "context" $) | nindent 2 }}
{{- end }}
{{- if .hostAliases }}
hostAliases: {{- include "helpers.tplvalues.render" (dict "value" .hostAliases "context" $) | nindent 2 }}
Expand Down
16 changes: 8 additions & 8 deletions templates/helpers/_workloads.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
env:
{{ with $general.envsFromConfigmap }}{{- include "helpers.configmaps.includeEnv" ( dict "value" . "context" $ctx) }}{{- end }}
{{ with $v.envsFromConfigmap }}{{- include "helpers.configmaps.includeEnv" ( dict "value" . "context" $ctx) }}{{- end }}
{{- with $general.envsFromSecret }}{{- include "helpers.secrets.includeEnv" ( dict "value" . "context" $ctx) }}{{- end }}
{{- with $v.envsFromSecret }}{{- include "helpers.secrets.includeEnv" ( dict "value" . "context" $ctx) }}{{- end }}
{{- with $general.env }}{{- include "helpers.tplvalues.render" ( dict "value" . "context" $ctx) }}{{- end }}
{{- with $v.env }}{{- include "helpers.tplvalues.render" ( dict "value" . "context" $ctx) }}{{- end }}
{{ with $general.envsFromSecret }}{{- include "helpers.secrets.includeEnv" ( dict "value" . "context" $ctx) }}{{- end }}
{{ with $v.envsFromSecret }}{{- include "helpers.secrets.includeEnv" ( dict "value" . "context" $ctx) }}{{- end }}
{{ with $general.env }}{{- include "helpers.tplvalues.render" ( dict "value" . "context" $ctx) }}{{- end }}
{{ with $v.env }}{{- include "helpers.tplvalues.render" ( dict "value" . "context" $ctx) }}{{- end }}
{{- end }}
{{- end }}

Expand All @@ -21,10 +21,10 @@ env:
envFrom:
{{ with $general.envConfigmaps }}{{- include "helpers.configmaps.includeEnvConfigmap" ( dict "value" . "context" $ctx) }}{{- end }}
{{ with $v.envConfigmaps }}{{- include "helpers.configmaps.includeEnvConfigmap" ( dict "value" . "context" $ctx) }}{{- end }}
{{- with $general.envSecrets }}{{- include "helpers.secrets.includeEnvSecret" ( dict "value" . "context" $ctx) }}{{- end }}
{{- with $v.envSecrets }}{{- include "helpers.secrets.includeEnvSecret" ( dict "value" . "context" $ctx) }}{{- end }}
{{- with $general.envFrom }}{{- include "helpers.tplvalues.render" ( dict "value" . "context" $ctx) }}{{- end }}
{{- with $v.envFrom }}{{- include "helpers.tplvalues.render" ( dict "value" . "context" $ctx) }}{{- end }}
{{ with $general.envSecrets }}{{- include "helpers.secrets.includeEnvSecret" ( dict "value" . "context" $ctx) }}{{- end }}
{{ with $v.envSecrets }}{{- include "helpers.secrets.includeEnvSecret" ( dict "value" . "context" $ctx) }}{{- end }}
{{ with $general.envFrom }}{{- include "helpers.tplvalues.render" ( dict "value" . "context" $ctx) }}{{- end }}
{{ with $v.envFrom }}{{- include "helpers.tplvalues.render" ( dict "value" . "context" $ctx) }}{{- end }}
{{- end }}
{{- end }}

Expand Down
10 changes: 5 additions & 5 deletions templates/serviceaccount.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ $name }}
name: {{ include "helpers.app.fullname" (dict "name" $name "context" $) }}
namespace: {{ $.Release.Namespace | quote }}
labels:
{{- include "helpers.app.labels" $ | nindent 4 }}
Expand Down Expand Up @@ -60,7 +60,7 @@ roleRef:
name: {{ include "helpers.app.fullname" (dict "name" $val.role.name "context" $) }}
subjects:
- kind: ServiceAccount
name: {{ $name }}
name: {{ include "helpers.app.fullname" (dict "name" $name "context" $) }}
namespace: {{ $.Release.Namespace | quote }}
{{- else }}
---
Expand All @@ -83,7 +83,7 @@ roleRef:
name: {{ $val.role.name }}
subjects:
- kind: ServiceAccount
name: {{ $name }}
name: {{ include "helpers.app.fullname" (dict "name" $name "context" $) }}
namespace: {{ $.Release.Namespace | quote }}
{{- end }}
{{- end }}
Expand Down Expand Up @@ -123,7 +123,7 @@ roleRef:
name: {{ include "helpers.app.fullname" (dict "name" $val.clusterRole.name "context" $) }}
subjects:
- kind: ServiceAccount
name: {{ $name }}
name: {{ include "helpers.app.fullname" (dict "name" $name "context" $) }}
namespace: {{ $.Release.Namespace | quote }}
{{- else }}
---
Expand All @@ -145,7 +145,7 @@ roleRef:
name: {{ $val.clusterRole.name }}
subjects:
- kind: ServiceAccount
name: {{ $name }}
name: {{ include "helpers.app.fullname" (dict "name" $name "context" $) }}
namespace: {{ $.Release.Namespace | quote }}
{{- end }}
{{- end }}
Expand Down

0 comments on commit c897f1d

Please sign in to comment.