From ea2b7509d001c55180b0bccefe253fe7b8dc9f43 Mon Sep 17 00:00:00 2001 From: Pavlos Tzianos Date: Wed, 17 Jul 2024 19:50:52 +0100 Subject: [PATCH] remove hooks from deduplication job and simplify parameters --- deploy/deduplication-db-migrations/chart/Chart.yaml | 4 ++-- .../chart/templates/migrations-job.yaml | 9 ++------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/deploy/deduplication-db-migrations/chart/Chart.yaml b/deploy/deduplication-db-migrations/chart/Chart.yaml index dc05ef2f7..0bfb82ffc 100644 --- a/deploy/deduplication-db-migrations/chart/Chart.yaml +++ b/deploy/deduplication-db-migrations/chart/Chart.yaml @@ -4,5 +4,5 @@ description: | A Helm chart for Kubernetes containing the dracon migrations needed for the deduplication component to run. Please check the documentation for more information here: https://github.com/ocurity/dracon/blob/main/docs/migrations.md type: application -version: 0.7.0 -appVersion: 0.7.0 +version: 0.23.0 +appVersion: v0.23.0 diff --git a/deploy/deduplication-db-migrations/chart/templates/migrations-job.yaml b/deploy/deduplication-db-migrations/chart/templates/migrations-job.yaml index 5b602cda1..3954feb18 100644 --- a/deploy/deduplication-db-migrations/chart/templates/migrations-job.yaml +++ b/deploy/deduplication-db-migrations/chart/templates/migrations-job.yaml @@ -5,12 +5,6 @@ metadata: name: {{ include "deduplication_db_migrations.fullname" . }} labels: {{- include "deduplication_db_migrations.labels" . | nindent 4 }} - annotations: - # This is what defines this resource as a hook. Without this line, the - # job is considered part of the release. - "helm.sh/hook": post-install,post-upgrade - "helm.sh/hook-weight": "-5" - "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded, hook-failed spec: template: metadata: @@ -21,7 +15,7 @@ spec: restartPolicy: Never containers: - name: enrichment-db-migrations - image: "{{ .Values.global.image.registry }}/draconctl:{{ .Values.image.tag | default .Chart.AppVersion }}" + image: "{{ default "ghcr.io/ocurity/dracon" .Values.image.registry }}/draconctl:{{ default .Chart.AppVersion .Values.image.tag }}" env: - name: DRACONCTL_MIGRATIONS_PATH value: "/etc/dracon/migrations/enrichment" @@ -31,5 +25,6 @@ spec: - apply - --url - "postgresql://{{ .Values.database.auth.username }}:{{ .Values.database.auth.password }}@{{ .Values.database.host }}/{{ .Values.database.auth.database }}?{{ .Values.database.auth.querystringargs}}" + - ${DRACONCTL_MIGRATIONS_PATH} serviceAccountName: {{ include "deduplication_db_migrations.fullname" . }} {{ end }}