Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/release-rc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
release:
needs: check-rc
if: ${{ needs.check-rc.outputs.rc == 'true' }}
uses: .github/workflows/release.yml
uses: ./.github/workflows/release.yml
secrets: inherit
with:
secrets: inherit
mark_as_latest: false
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ on:
inputs:
mark_as_latest:
type: boolean
description: 'Whether to mark the chart as the latest release'
required: false
default: true
workflow_dispatch:
inputs:
mark_as_latest:
description: 'Whether to mark the chart as the latest release'
type: boolean
required: false
default: true
Expand Down
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.11.0
version: 0.11.1-rc.2
appVersion: "0.1.0"
home: https://getport.io/
sources:
Expand Down
15 changes: 15 additions & 0 deletions charts/port-ocean/templates/cron-job/_helpers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,18 @@ Supports optional custom naming via workload.cron.initContainer.serviceAccount.n
{{- printf "%s-job-query" $prefix | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end }}

{{/*
Get installation resync job name
*/}}
{{- define "port-ocean.installationResyncJobName" -}}
{{- printf "init-sync-%s" .Release.Name }}
{{- end }}

{{/*
Get installation triggered job name
*/}}
{{- define "port-ocean.installationTriggeredJobName" -}}
{{- $jobName := (print (randAlphaNum 4) "-" .Release.Revision) | lower }}
{{- printf "init-sync-%s" $jobName }}
{{- end }}
11 changes: 5 additions & 6 deletions charts/port-ocean/templates/cron-job/installation-resync-job.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
{{- $resyncOnInstall := (.Values.workload.cron).resyncOnInstall | default true }}
{{- $resyncOnUpgrade := (.Values.workload.cron).resyncOnUpgrade | default true }}
{{- if and (eq .Values.workload.kind "CronJob") (or $resyncOnInstall $resyncOnUpgrade) }}
{{- $jobName := (print (randAlphaNum 4) "-" .Release.Revision) | lower }}
{{- $shouldResyncOnInstall := and (.Values.workload.cron.resyncOnInstall) (eq .Release.Revision 1) }}
{{- $shouldResyncOnUpgrade := and (.Values.workload.cron.resyncOnUpgrade) (gt .Release.Revision 1) }}
{{- if and (eq .Values.workload.kind "CronJob") (or $shouldResyncOnInstall $shouldResyncOnUpgrade) }}
apiVersion: batch/v1
kind: Job
metadata:
annotations:
helm.sh/hook: post-install, post-upgrade
helm.sh/hook-delete-policy: hook-succeeded, hook-failed
name: init-sync-{{ .Release.Name }}-{{ $jobName }}
name: {{ include "port-ocean.installationResyncJobName" . }}
spec:
ttlSecondsAfterFinished: 600
activeDeadlineSeconds: 180
Expand All @@ -27,6 +26,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-sync-{{ $jobName }} --token=$TOKEN
- kubectl create job --from=cronjob/{{ include "port-ocean.cronJobName" . }} {{ include "port-ocean.installationTriggeredJobName" . }} --token=$TOKEN
restartPolicy: Never
{{- end }}
Loading