Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add post-upgrade hook to helm installer job in case of upgrade #312

Merged
merged 42 commits into from
Jul 15, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
132bc42
Update _pega-installer-job.tpl
amansharma00a Jun 20, 2021
6873acd
Update pega-installer-config.yaml
amansharma00a Jun 22, 2021
1905e61
Update _helpers.tpl
amansharma00a Jun 22, 2021
ff33d09
Update _helpers.tpl
amansharma00a Jun 23, 2021
86281c9
Update pega-installer-config.yaml
amansharma00a Jun 23, 2021
21075b5
Update _helpers.tpl
amansharma00a Jun 23, 2021
d4adf1f
Update _pega-installer-job.tpl
amansharma00a Jun 23, 2021
7a9906d
Update _pega-credentials-secret.tpl
amansharma00a Jun 24, 2021
ba3d5c9
Update _pega-registry-secret.tpl
amansharma00a Jun 24, 2021
02a32cb
Update _pega-installer-job.tpl
amansharma00a Jun 24, 2021
c38e3ab
Update _pega-installer-job.tpl
amansharma00a Jun 24, 2021
2e835e6
Update _helpers.tpl
amansharma00a Jun 24, 2021
ff4573d
Update _pega-installer-job.tpl
amansharma00a Jun 24, 2021
029c260
Update _helpers.tpl
amansharma00a Jun 24, 2021
5a771d3
Update _helpers.tpl
amansharma00a Jun 24, 2021
7d67019
Update _pega-installer-job.tpl
amansharma00a Jun 24, 2021
fa49306
Update _pega-installer-job.tpl
amansharma00a Jun 24, 2021
faa945f
Update pega-installer-job_test.go
amansharma00a Jun 24, 2021
8af3c2b
Update _helpers.tpl
amansharma00a Jun 24, 2021
4d1b3ac
Update _pega-installer-job.tpl
amansharma00a Jun 24, 2021
f73553a
Update _pega-installer-job.tpl
amansharma00a Jun 24, 2021
bb97e91
Merge branch 'pegasystems:master' into master
amansharma00a Jun 24, 2021
190a7a1
Update _pega-credentials-secret.tpl
amansharma00a Jun 25, 2021
7379f5f
Update _pega-registry-secret.tpl
amansharma00a Jun 25, 2021
e70f25c
Update _pega-installer-job.tpl
amansharma00a Jun 25, 2021
f446336
Update _helpers.tpl
amansharma00a Jun 27, 2021
b7e3187
Update _pega-installer-job.tpl
amansharma00a Jun 27, 2021
5ff0f9a
Update _pega-installer-job.tpl
amansharma00a Jun 27, 2021
49f3aea
Update _pega-installer-job.tpl
amansharma00a Jun 27, 2021
822248c
Update _pega-installer-job.tpl
amansharma00a Jun 27, 2021
40c4ec8
Merge branch 'pegasystems:master' into master
amansharma00a Jun 27, 2021
ba3acef
Update _pega-installer-job.tpl
amansharma00a Jun 27, 2021
676a45c
Update _pega-installer-job.tpl
amansharma00a Jun 27, 2021
2a0c84f
Merge branch 'master' into master
MadhuriArugula Jul 5, 2021
a96b80d
Update _helpers.tpl
amansharma00a Jul 7, 2021
33c3782
Merge branch 'master' into master
MadhuriArugula Jul 7, 2021
225391f
Merge branch 'pegasystems:master' into master
amansharma00a Jul 9, 2021
fff688e
Merge branch 'master' into master
MadhuriArugula Jul 13, 2021
73671c1
Update pega-installer-job_test.go
amansharma00a Jul 14, 2021
adaf6c6
Update pega-installer-job_test.go
amansharma00a Jul 14, 2021
f1a3b72
Create pega-custom-upgrade_test.go
amansharma00a Jul 14, 2021
88bd564
Update pega-custom-upgrade_test.go
amansharma00a Jul 14, 2021
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
3 changes: 2 additions & 1 deletion charts/pega/charts/installer/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{{- define "pegaVolumeInstall" }}pega-volume-installer{{- end }}
{{- define "pegaInstallConfig" }}pega-installer-config{{- end }}
{{- define "pegaUpgradelConfig" }}pega-upgrade-config{{- end }}
MadhuriArugula marked this conversation as resolved.
Show resolved Hide resolved
{{- define "pegaDBInstall" -}}pega-db-install{{- end -}}
{{- define "pegaDBCustomUpgrade" -}}pega-db-custom-upgrade{{- end -}}
{{- define "pegaDBOOPRulesUpgrade" -}}pega-db-ooprules-upgrade{{- end -}}
Expand Down Expand Up @@ -98,4 +99,4 @@
- name: KUBERNETES_SERVICE_PORT
value: {{ $apiserver.httpsServicePort | quote }}
{{- end }}
{{- end }}
{{- end }}
13 changes: 10 additions & 3 deletions charts/pega/charts/installer/templates/_pega-installer-job.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,19 @@ metadata:
name: {{ .name }}
namespace: {{ .root.Release.Namespace }}
annotations:
{{- if and (eq .root.Values.waitForJobCompletion "true") (or (eq .root.Values.global.actions.execute "install") (eq .root.Values.global.actions.execute "upgrade")) }}
# Forces Helm to wait for the install or upgrade to complete.
"helm.sh/hook": post-install
{{- if (eq .root.Values.waitForJobCompletion "true") }}
"helm.sh/hook-weight": "0"
"helm.sh/hook-delete-policy": before-hook-creation
{{- if (eq .root.Values.global.actions.execute "install") }}
# Forces Helm to wait for the install to complete.
"helm.sh/hook": post-install
{{- end }}
{{- if (eq .root.Values.global.actions.execute "upgrade") }}
# Forces Helm to wait for the upgrade to complete.
"helm.sh/hook": post-install, post-upgrade
{{- end }}
{{- end }}

amansharma00a marked this conversation as resolved.
Show resolved Hide resolved
{{- if .root.Values.global.pegaJob }}{{- if .root.Values.global.pegaJob.annotations }}
{{ toYaml .root.Values.global.pegaJob.annotations | indent 4 }}
{{- end }}{{- end }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
{{ if or (eq (include "performInstall" .) "true") (eq (include "performUpgrade" .) "true") }}
{{ if (eq (include "performInstall" .) "true") }}
{{ template "pega.installer.config" dict "root" $ "dbType" .Values.global.jdbc.dbType "name" (include "pegaInstallConfig" .) "mode" (include "installerConfig" .) }}
{{ end }}
{{ end }}

{{ if (eq (include "performUpgrade" .) "true") }}
{{ template "pega.installer.config" dict "root" $ "dbType" .Values.global.jdbc.dbType "name" (include "pegaUpgradelConfig" .) "mode" (include "installerConfig" .) }}
MadhuriArugula marked this conversation as resolved.
Show resolved Hide resolved
{{ end }}