diff --git a/library/common-test/ci/register-operator-values.yaml b/library/common-test/ci/register-operator-values.yaml index 035f0bb8..c2723315 100644 --- a/library/common-test/ci/register-operator-values.yaml +++ b/library/common-test/ci/register-operator-values.yaml @@ -42,3 +42,10 @@ args: operator: register: true + +manifestManager: + enabled: false + staging: false + install: false + check: false + delete: false diff --git a/library/common/Chart.yaml b/library/common/Chart.yaml index 16b37168..70226774 100644 --- a/library/common/Chart.yaml +++ b/library/common/Chart.yaml @@ -15,4 +15,4 @@ maintainers: name: common sources: null type: library -version: 12.10.2 +version: 12.10.3 diff --git a/library/common/templates/lib/util/_manifest_manager.tpl b/library/common/templates/lib/util/_manifest_manager.tpl index 08df1ae9..eb6522d7 100644 --- a/library/common/templates/lib/util/_manifest_manager.tpl +++ b/library/common/templates/lib/util/_manifest_manager.tpl @@ -83,11 +83,14 @@ spec: {{- $handleErr = "&& echo 'Job failed...'" -}} {{- end }} + {{- if .Values.manifestManager.install }} kubectl apply --server-side --force-conflicts --grace-period 30 --v=4 -k https://github.com/truecharts/manifests/{{ $branch }} || \ kubectl apply --server-side --force-conflicts --grace-period 30 -k https://github.com/truecharts/manifests/{{ $branch }} {{ $handleErr }} echo "Install finished..." + {{- end }} + {{- if .Values.manifestManager.check }} echo "Starting waits and checks..." kubectl delete pod --field-selector=status.phase==Succeeded -n cnpg-system || echo "Delete of Completed Pods failed..." kubectl delete pod --field-selector=status.phase==Failed -n cnpg-system || echo "Delete of Failed Pods failed..." @@ -102,6 +105,16 @@ spec: kubectl wait --namespace cert-manager --for=condition=ready pod --selector=app.kubernetes.io/instance=cert-manager --timeout=60s || echo "cert-manager wait failed..." cmctl check api --wait=1m || echo "cmctl wait failed..." + + echo "Checks finished..." + {{- end }} + + {{- if .Values.manifestManager.delete -}} + echo "Deleting manifests..." + kubectl delete --grace-period 30 --v=4 -k https://github.com/truecharts/manifests/delete && kubectl delete --grace-period 30 --v=4 -k https://github.com/truecharts/manifests/delete || \ + kubectl delete --force --grace-period 30 -k https://github.com/truecharts/manifests/delete {{ $handleErr }} + echo "Deletion finished..." + {{- end }} EOF volumeMounts: - name: {{ $fullName }}-manifests-temp diff --git a/library/common/values.yaml b/library/common/values.yaml index b266f8c4..1daf16ac 100644 --- a/library/common/values.yaml +++ b/library/common/values.yaml @@ -312,8 +312,11 @@ APPURL: "" # -- Used to inject our own operator manifests into SCALE manifestManager: - enabled: false + enabled: true staging: false + install: true + check: true + delete: false gluetunImage: repository: tccr.io/truecharts/gluetun