Skip to content

Commit

Permalink
Fix/migration hook (#18)
Browse files Browse the repository at this point in the history
* Allow users to not define KEY MANAGER envs

* Separate hook env and pre-install, pre-update

Bump version to 1.0.8

Co-authored-by: gabriel.garrido <gabriel.garrido@consensys.net>
  • Loading branch information
6l20 and ggarri committed Apr 3, 2022
1 parent 5841fea commit 74b7a9a
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: v2
description: Helm chart for Orchestrate
name: orchestrate
type: application
version: 1.0.7
version: 1.0.8
home: https://docs.orchestrate.consensys.net/
icon: https://docs.orchestrate.consensys.net/en/stable/images/logo.svg
maintainers:
Expand Down
18 changes: 18 additions & 0 deletions templates/api/hook-configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{{- if .Values.api.enabled }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "orchestrate.api.fullname" . }}-hook-envmap
labels:
{{- include "orchestrate.api.labels" . | nindent 4 }}
annotations:
{{- include "orchestrate.annotations" . | nindent 4 }}
data:
{{- range $key,$value := .Values.global.environment }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- range $key,$value := .Values.api.environment }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
20 changes: 20 additions & 0 deletions templates/api/hook-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{{- if and (.Values.api.enabled) (or .Values.api.environmentSecrets .Values.global.environmentSecrets) }}
---
apiVersion: v1
kind: Secret
metadata:
name: {{ template "orchestrate.api.fullname" . }}-hook-secretmap
labels:
{{- include "orchestrate.api.labels" . | nindent 4 }}
annotations:
{{- include "orchestrate.annotations" . | nindent 4 }}
type: Opaque
data:
{{- range $key,$value := .Values.global.environmentSecrets }}
{{ $key }}: {{ $value | b64enc | quote }}
{{- end }}
{{- range $key,$value := .Values.api.environmentSecrets }}
{{ $key }}: {{ $value | b64enc | quote }}
{{- end }}
{{- end }}

2 changes: 1 addition & 1 deletion templates/api/init-migrate-hook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ metadata:
{{- include "orchestrate.api.labels" . | nindent 4 }}
annotations:
{{- include "orchestrate.annotations" . | nindent 4 }}
"helm.sh/hook": pre-install
"helm.sh/hook": pre-install, pre-update
"helm.sh/hook-weight": "10"
"helm.sh/hook-delete-policy": hook-succeeded
spec:
Expand Down

0 comments on commit 74b7a9a

Please sign in to comment.