Skip to content

Commit

Permalink
Merge pull request #127 from port-labs/ocean-cron-name-length
Browse files Browse the repository at this point in the history
fix(ocean): Shorten the name of the cron jobs
  • Loading branch information
yairsimantov20 authored Jul 4, 2024
2 parents f4956e8 + 5f54101 commit cbae2d6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion charts/port-ocean/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 4 additions & 0 deletions charts/port-ocean/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/}}
Expand Down
2 changes: 1 addition & 1 deletion charts/port-ocean/templates/cron-job/cron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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" . }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}

0 comments on commit cbae2d6

Please sign in to comment.