From 0aff7fccd041cc85b44f06d7ff003a931353dc18 Mon Sep 17 00:00:00 2001 From: yair Date: Mon, 24 Jun 2024 16:41:28 +0300 Subject: [PATCH 1/2] shorten the name of the cron jobs --- charts/port-ocean/templates/_helpers.tpl | 4 ++++ charts/port-ocean/templates/cron-job/cron.yaml | 2 +- .../port-ocean/templates/cron-job/installation-resync-job.yml | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/charts/port-ocean/templates/_helpers.tpl b/charts/port-ocean/templates/_helpers.tpl index 270ca26..957236d 100644 --- a/charts/port-ocean/templates/_helpers.tpl +++ b/charts/port-ocean/templates/_helpers.tpl @@ -60,6 +60,10 @@ Get prefix of ocean resource metadata.name {{- printf "ocean-%s-%s" .Values.integration.type .Values.integration.identifier }} {{- end }} +{{- define "port-ocean.metadataNamePrefixShort" -}} +{{- printf "%s-%s" .Values.integration.type .Values.integration.identifier }} +{{- end }} + {{/* Get config map name */}} diff --git a/charts/port-ocean/templates/cron-job/cron.yaml b/charts/port-ocean/templates/cron-job/cron.yaml index 470f2c9..09aa736 100644 --- a/charts/port-ocean/templates/cron-job/cron.yaml +++ b/charts/port-ocean/templates/cron-job/cron.yaml @@ -17,7 +17,7 @@ spec: concurrencyPolicy: Replace jobTemplate: metadata: - generateName: {{ include "port-ocean.cronJobName" . }}- + generateName: {{ include "port-ocean.metadataNamePrefixShort" . }}- namespace: {{ .Release.Namespace }} labels: app: {{ include "port-ocean.cronJobName" . }} diff --git a/charts/port-ocean/templates/cron-job/installation-resync-job.yml b/charts/port-ocean/templates/cron-job/installation-resync-job.yml index e0c70c4..2c84872 100644 --- a/charts/port-ocean/templates/cron-job/installation-resync-job.yml +++ b/charts/port-ocean/templates/cron-job/installation-resync-job.yml @@ -8,7 +8,7 @@ metadata: annotations: helm.sh/hook: post-install, post-upgrade helm.sh/hook-delete-policy: hook-succeeded, hook-failed - name: {{ include "port-ocean.cronJobName" . }}-init-resync-{{ .Release.Name }}-{{ $jobName }} + name: init-sync-{{ .Release.Name }}-{{ $jobName }} spec: ttlSecondsAfterFinished: 600 activeDeadlineSeconds: 30 @@ -27,6 +27,6 @@ spec: name: {{ include "port-ocean.cron.job-query-rbac-prefix" . }}-sa-token key: token args: - - kubectl create job --from=cronjob/{{ include "port-ocean.cronJobName" . }} init-resync-{{ .Release.Name }}-{{ $jobName }} --token=$TOKEN + - kubectl create job --from=cronjob/{{ include "port-ocean.cronJobName" . }} init-sync-{{ $jobName }} --token=$TOKEN restartPolicy: Never {{- end }} \ No newline at end of file From 5f54101c2991dc29a708fe0c048a9cd5af663c14 Mon Sep 17 00:00:00 2001 From: yair Date: Mon, 24 Jun 2024 16:42:42 +0300 Subject: [PATCH 2/2] bump --- charts/port-ocean/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/port-ocean/Chart.yaml b/charts/port-ocean/Chart.yaml index f65cdfd..197034c 100644 --- a/charts/port-ocean/Chart.yaml +++ b/charts/port-ocean/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: port-ocean description: A Helm chart for Port Ocean integrations type: application -version: 0.4.1 +version: 0.4.2 appVersion: "0.1.0" home: https://getport.io/ sources: