From 2775a74bdbbe83232a22797f3f623a5d83f66276 Mon Sep 17 00:00:00 2001 From: Jacques ROUSSEL Date: Tue, 24 Sep 2024 12:05:54 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8(ci)=20add=20helmfile=20linter=20and?= =?UTF-8?q?=20fix=20issue=20in=20argocd=20sync?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a github job to run helmfile linter on PR Add argocd annotation to fix job syncing issue --- .github/workflows/helmfile-linter.yaml | 22 +++++++++++++++++++ secrets | 2 +- src/helm/impress/templates/backend_job.yaml | 3 ++- .../backend_job_createsuperuser.yaml | 3 ++- 4 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/helmfile-linter.yaml diff --git a/.github/workflows/helmfile-linter.yaml b/.github/workflows/helmfile-linter.yaml new file mode 100644 index 000000000..26b830b41 --- /dev/null +++ b/.github/workflows/helmfile-linter.yaml @@ -0,0 +1,22 @@ +name: Helmfile lint +run-name: Helmfile lint + +on: + pull_request: + branches: + - 'main' + +jobs: + helmfile-lint: + runs-on: ubuntu-latest + container: + image: ghcr.io/helmfile/helmfile:latest + steps: + - + uses: numerique-gouv/action-helmfile-lint@main + with: + app-id: ${{ secrets.APP_ID }} + age-key: ${{ secrets.SOPS_PRIVATE }} + private-key: ${{ secrets.PRIVATE_KEY }} + helmfile-src: "src/helm" + repositories: "impress,secrets" diff --git a/secrets b/secrets index 2643697e5..38594182e 160000 --- a/secrets +++ b/secrets @@ -1 +1 @@ -Subproject commit 2643697e5f15279f0eca403ba591260e71ec499d +Subproject commit 38594182e8f3625f9f39d85c597407d9ce6bf23b diff --git a/src/helm/impress/templates/backend_job.yaml b/src/helm/impress/templates/backend_job.yaml index f55447ae3..9c81d7df4 100644 --- a/src/helm/impress/templates/backend_job.yaml +++ b/src/helm/impress/templates/backend_job.yaml @@ -6,8 +6,9 @@ kind: Job metadata: name: {{ $fullName }}-migrate namespace: {{ .Release.Namespace | quote }} - {{- with .Values.backend.migrateJobAnnotations }} annotations: + argocd.argoproj.io/sync-options: Replace=true,Force=true + {{- with .Values.backend.migrateJobAnnotations }} {{- toYaml . | nindent 4 }} {{- end }} labels: diff --git a/src/helm/impress/templates/backend_job_createsuperuser.yaml b/src/helm/impress/templates/backend_job_createsuperuser.yaml index c6b6949bf..beb7d65e1 100644 --- a/src/helm/impress/templates/backend_job_createsuperuser.yaml +++ b/src/helm/impress/templates/backend_job_createsuperuser.yaml @@ -6,8 +6,9 @@ kind: Job metadata: name: {{ $fullName }}-createsuperuser namespace: {{ .Release.Namespace | quote }} - {{- with .Values.backend.migrateJobAnnotations }} annotations: + argocd.argoproj.io/sync-options: Replace=true,Force=true + {{- with .Values.backend.migrateJobAnnotations }} {{- toYaml . | nindent 4 }} {{- end }} labels: