Skip to content

Commit

Permalink
Change type of hooks (BREAKING CHANGE)
Browse files Browse the repository at this point in the history
  • Loading branch information
Evgeny Tereshkov committed Apr 3, 2022
1 parent 86e44e4 commit 6783cb0
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 15 deletions.
5 changes: 5 additions & 0 deletions charts/universal-chart/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Changelog

## 2.0.0 - April 3, 2022

* `hooks` is a map of the Helm Hooks Jobs parameters, where key is a name of job.
2 changes: 1 addition & 1 deletion charts/universal-chart/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: 1.1.0
version: 2.0.0
maintainers:
- name: Roman Andreev
email: [email protected]
Expand Down
3 changes: 1 addition & 2 deletions charts/universal-chart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,11 +257,10 @@ Secret `data` object is a map where value can be a string, json or base64 encode
| `hooksGeneral.affinity` | Affinity for Hook Job; replicas pods assignment (ignored if defined on Hook level) | `{}` |
| `hooksGeneral.dnsPolicy` | DnsPolicy for Hook Job pods (ignored if defined on Hook level) | `""` |

`hooks` is a list of the Helm Hooks Jobs parameters.
`hooks` is a map of the Helm Hooks Jobs parameters, where key is a name of job.

| Name | Description | Value |
|---------------------------|------------------------------------------------------------------------------------------|-----------------------------|
| `name` | Name of the Hook Job | `""` |
| `labels` | Extra Hook Job labels | `{}` |
| `annotations` | Extra Hook Job annotations | `{}` |
| `kind` | Kind of the Helm Hook | `"pre-install,pre-upgrade"` |
Expand Down
13 changes: 2 additions & 11 deletions charts/universal-chart/templates/helm-hooks.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
{{- $hooks := list -}}
{{- if .Values.hooks -}}
{{- if kindIs "string" .Values.hooks -}}
{{- $HD := fromYaml (printf "hooks:\n%s" .Values.hooks) -}}
{{- $hooks = $HD.hooks -}}
{{- else if kindIs "slice" .Values.hooks -}}
{{- $hooks = .Values.hooks -}}
{{- end -}}
{{- end -}}
{{- $general := $.Values.hooksGeneral -}}
{{- range $hooks }}
{{- $hookName := include "helpers.app.fullname" (dict "name" .name "context" $) }}
{{- range $name, $hook := .Values.hooks }}
{{- $hookName := include "helpers.app.fullname" (dict "name" $name "context" $) }}
---
apiVersion: batch/v1
kind: Job
Expand Down
2 changes: 1 addition & 1 deletion charts/universal-chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ pvcs: {}
# - ReadWriteMany
# size: 8Gi

hooks: []
hooks: {}

cronJobs: []
#- name: generate-data
Expand Down

0 comments on commit 6783cb0

Please sign in to comment.