From 00f18b8b698a08fdc105df26666a1914e8aeb052 Mon Sep 17 00:00:00 2001 From: Stefan McShane Date: Wed, 2 Oct 2024 10:57:41 -0400 Subject: [PATCH 1/4] Add PORTER_IMAGE_TAG to jobs --- applications/job/templates/cronjob.yaml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/applications/job/templates/cronjob.yaml b/applications/job/templates/cronjob.yaml index f7ccfae58..c54e4f83c 100644 --- a/applications/job/templates/cronjob.yaml +++ b/applications/job/templates/cronjob.yaml @@ -121,6 +121,14 @@ spec: {{ end }} {{ end }} env: + {{- if .Values.global }} + {{- if .Values.global.image }} + {{- if .Values.global.image.tag }} + - name: PORTER_IMAGE_TAG + value: "{{ .Values.global.image.tag }}" + {{- end }} + {{- end }} + {{- end }} {{- range $key, $val := .Values.container.env.normal }} - name: {{ $key }} {{- $splVal := split "_" $val -}} @@ -258,4 +266,4 @@ spec: {{- if (.Values.sidecar.timeout) }} activeDeadlineSeconds: {{ .Values.sidecar.timeout }} {{- end }} -{{ end }} \ No newline at end of file +{{ end }} From 38aefce4fd5a508edb2cf6a1331e1790de541662 Mon Sep 17 00:00:00 2001 From: Stefan McShane Date: Wed, 2 Oct 2024 11:16:27 -0400 Subject: [PATCH 2/4] chore: add job test.yaml --- applications/testdata/job.yaml | 59 ++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 applications/testdata/job.yaml diff --git a/applications/testdata/job.yaml b/applications/testdata/job.yaml new file mode 100644 index 000000000..be5efc8b5 --- /dev/null +++ b/applications/testdata/job.yaml @@ -0,0 +1,59 @@ +cloudsql: + connectionName: "" + dbPort: 0 + enabled: false + serviceAccountJSONSecret: "" +configMapRefs: +- dev.2 +- 5300-db00d8.10 +container: + command: python runjob.py + env: + normal: null + port: 3000 +deploymentStrategy: + blueGreen: {} +fileSecretMounts: + enabled: false + mounts: null +fullnameOverride: job-dev +labels: + porter.run/absolute-name: job-dev + porter.run/app-id: "5300" + porter.run/app-instance-id: 2e9b5ad3-d53c-4bf7-9945-7dc59336f44e + porter.run/app-name: porter-app + porter.run/app-revision-id: 3db36407-cdff-4cf7-9cd2-c91ea5b6fcdd + porter.run/deployment-target-id: db00d884-f248-493d-9263-9286d7cbde37 + porter.run/porter-application: "true" + porter.run/project-id: "11419" + porter.run/service-name: job-dev + porter.run/service-type: job +nodeGroups: null +paused: true +podAnnotations: {} +podLabels: + porter.run/absolute-name: job-dev + porter.run/app-id: "5300" + porter.run/app-name: alert-pipeline-dev + porter.run/porter-application: "true" + porter.run/service-name: classifier-dev + porter.run/service-type: job +replicaCount: 1 +resources: + limits: {} + requests: + cpu: "2.5" + memory: 10430M +schedule: + enabled: false + value: 1 2 3 4 5 +secretRefs: +- dev.2 +- 5300-db00d8.10 +sidecar: + timeout: 86400 +terminationGracePeriodSeconds: 30 +global: + image: + tag: "1234adfa" + repository: "porterdev/hello-porter" \ No newline at end of file From 9d25de14440730606e3400d16533333f5dbc147d Mon Sep 17 00:00:00 2001 From: Stefan McShane Date: Wed, 2 Oct 2024 11:17:11 -0400 Subject: [PATCH 3/4] chore: add job test.yaml --- applications/testdata/job.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/applications/testdata/job.yaml b/applications/testdata/job.yaml index be5efc8b5..9bb777049 100644 --- a/applications/testdata/job.yaml +++ b/applications/testdata/job.yaml @@ -25,7 +25,6 @@ labels: porter.run/app-revision-id: 3db36407-cdff-4cf7-9cd2-c91ea5b6fcdd porter.run/deployment-target-id: db00d884-f248-493d-9263-9286d7cbde37 porter.run/porter-application: "true" - porter.run/project-id: "11419" porter.run/service-name: job-dev porter.run/service-type: job nodeGroups: null @@ -33,7 +32,6 @@ paused: true podAnnotations: {} podLabels: porter.run/absolute-name: job-dev - porter.run/app-id: "5300" porter.run/app-name: alert-pipeline-dev porter.run/porter-application: "true" porter.run/service-name: classifier-dev From 7c970faa835ca46c3affefb7c3a7ff5e7f06ac94 Mon Sep 17 00:00:00 2001 From: Stefan McShane Date: Wed, 2 Oct 2024 11:25:20 -0400 Subject: [PATCH 4/4] chore: add job test.yaml --- .github/workflows/pr_checks.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr_checks.yaml b/.github/workflows/pr_checks.yaml index ea1cc728e..b02a188a9 100644 --- a/.github/workflows/pr_checks.yaml +++ b/.github/workflows/pr_checks.yaml @@ -41,4 +41,9 @@ jobs: - name: Helm template - worker if: steps.changed-files.outputs.any_changed == 'true' shell: bash - run: helm template applications/worker -f applications/testdata/worker.yaml \ No newline at end of file + run: helm template applications/worker -f applications/testdata/worker.yaml + + - name: Helm template - job + if: steps.changed-files.outputs.any_changed == 'true' + shell: bash + run: helm template applications/job -f applications/testdata/job.yaml \ No newline at end of file