From 95d52d66454bf37aba1d92e348fd3141f7e9736b Mon Sep 17 00:00:00 2001 From: yair Date: Wed, 10 Jul 2024 14:00:51 +0300 Subject: [PATCH 1/6] change the job name to lowercase for ocean cron installation --- .../port-ocean/templates/cron-job/installation-resync-job.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 2c84872..d50851a 100644 --- a/charts/port-ocean/templates/cron-job/installation-resync-job.yml +++ b/charts/port-ocean/templates/cron-job/installation-resync-job.yml @@ -1,7 +1,7 @@ {{- $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 }} +{{- $jobName := (print (randAlphaNum 4) "-" .Release.Revision) | lower }} apiVersion: batch/v1 kind: Job metadata: From 418ac5983ab75012b07c373a08047dbc83231d39 Mon Sep 17 00:00:00 2001 From: yair Date: Wed, 10 Jul 2024 14:01:02 +0300 Subject: [PATCH 2/6] support suspending the cron --- charts/port-ocean/templates/cron-job/cron.yaml | 3 ++- charts/port-ocean/values.yaml | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/charts/port-ocean/templates/cron-job/cron.yaml b/charts/port-ocean/templates/cron-job/cron.yaml index 09aa736..bcd5c01 100644 --- a/charts/port-ocean/templates/cron-job/cron.yaml +++ b/charts/port-ocean/templates/cron-job/cron.yaml @@ -13,7 +13,8 @@ metadata: spec: failedJobsHistoryLimit: 5 successfulJobsHistoryLimit: 1 - schedule: {{ required "scheduledResyncInterval is required when using CronJob workload kind" .Values.scheduledResyncInterval | quote }} + schedule: {{ .Values.scheduledResyncInterval | default "0 */1 * * *" }} + suspend: {{ or .Values.workload.cron.suspend (eq .Values.scheduledResyncInterval "")}} concurrencyPolicy: Replace jobTemplate: metadata: diff --git a/charts/port-ocean/values.yaml b/charts/port-ocean/values.yaml index fb5e994..63580f3 100644 --- a/charts/port-ocean/values.yaml +++ b/charts/port-ocean/values.yaml @@ -46,6 +46,7 @@ workload: resyncTimeoutMinutes: null resyncOnInstall: true resyncOnUpgrade: true + suspend: false resources: requests: From 46e531bc7bcf3169c997d98cbed0e4cf198e869a Mon Sep 17 00:00:00 2001 From: yair Date: Wed, 10 Jul 2024 14:04:22 +0300 Subject: [PATCH 3/6] bump --- charts/port-ocean/Chart.yaml | 2 +- charts/port-ocean/README.md | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/charts/port-ocean/Chart.yaml b/charts/port-ocean/Chart.yaml index 197034c..47ad77a 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.2 +version: 0.5.0 appVersion: "0.1.0" home: https://getport.io/ sources: diff --git a/charts/port-ocean/README.md b/charts/port-ocean/README.md index 126da73..80c481c 100644 --- a/charts/port-ocean/README.md +++ b/charts/port-ocean/README.md @@ -56,15 +56,16 @@ The following table lists the configuration parameters of the `port-ocean` chart | `scheduledResyncInterval` | The number in minutes to reschedule and poll data from the 3rd party system. When workload.kind is set to CronJob this parameter is required and should be in a format of a cron string | `null` | | `sendRawDataExamples` | Enable sending raw data examples from the third party API to port for testing and managing the integration mapping | `true` | | `podAnnotations` | Annotations to be added to the pod. | `{}` | -| `podServiceAccount.name` | Service account to attach to the pod. | `null` | +| `podServiceAccount.name` | Service account to attach to the pod. | `null` | | `podSecurityContext` | Security context applied to the pod. | `{}` | | `containerSecurityContext` | Security context applied to the container. | `{}` | | `extraInitContainers` | Additional init containers to be added to the pod. | `[]` | | `workload.kind` | Kind of the workload. Can be either Deployment or CronJob | `Deployment` | | `workload.deployment.rolloutStrategy` | Deployment rollout strategy. | `Recreate` | | `workload.cron.resyncTimeoutMinutes` | Timeout in minutes for the resync cron job. When set to 0 or null, the cron job will not have a timeout. | `60` | -| `workload.cron.resyncOnInstall` | Should the first instllation trigger a resync job. | `true` | +| `workload.cron.resyncOnInstall` | Should the first installation trigger a resync job. | `true` | | `workload.cron.resyncOnUpgrade` | Should the upgrade trigger a resync job. | `true` | +| `workload.cron.suspend` | Should the cron scheduling be enabled | `true` | | `securityContext` | Security context applied to the container. | `{}` | | `resources` | Container resource requests and limits. | `{}` | | `nodeSelector` | NodeSelector applied to the pod. | `{}` | From 8a430a848314d24ffb85eba29e64ecd501dfdc4c Mon Sep 17 00:00:00 2001 From: yair Date: Wed, 10 Jul 2024 14:00:51 +0300 Subject: [PATCH 4/6] change the job name to lowercase for ocean cron installation --- .../port-ocean/templates/cron-job/installation-resync-job.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 2c84872..d50851a 100644 --- a/charts/port-ocean/templates/cron-job/installation-resync-job.yml +++ b/charts/port-ocean/templates/cron-job/installation-resync-job.yml @@ -1,7 +1,7 @@ {{- $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 }} +{{- $jobName := (print (randAlphaNum 4) "-" .Release.Revision) | lower }} apiVersion: batch/v1 kind: Job metadata: From 1a64c6d25782c7b2bc82c2be24073abee191fb04 Mon Sep 17 00:00:00 2001 From: yair Date: Wed, 10 Jul 2024 14:01:02 +0300 Subject: [PATCH 5/6] support suspending the cron --- charts/port-ocean/templates/cron-job/cron.yaml | 3 ++- charts/port-ocean/values.yaml | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/charts/port-ocean/templates/cron-job/cron.yaml b/charts/port-ocean/templates/cron-job/cron.yaml index 09aa736..bcd5c01 100644 --- a/charts/port-ocean/templates/cron-job/cron.yaml +++ b/charts/port-ocean/templates/cron-job/cron.yaml @@ -13,7 +13,8 @@ metadata: spec: failedJobsHistoryLimit: 5 successfulJobsHistoryLimit: 1 - schedule: {{ required "scheduledResyncInterval is required when using CronJob workload kind" .Values.scheduledResyncInterval | quote }} + schedule: {{ .Values.scheduledResyncInterval | default "0 */1 * * *" }} + suspend: {{ or .Values.workload.cron.suspend (eq .Values.scheduledResyncInterval "")}} concurrencyPolicy: Replace jobTemplate: metadata: diff --git a/charts/port-ocean/values.yaml b/charts/port-ocean/values.yaml index 107a9da..6f1203c 100644 --- a/charts/port-ocean/values.yaml +++ b/charts/port-ocean/values.yaml @@ -46,6 +46,7 @@ workload: resyncTimeoutMinutes: null resyncOnInstall: true resyncOnUpgrade: true + suspend: false resources: requests: From ae5291cd7cf656fbb46cf2d86dce3dbcc32e5ee2 Mon Sep 17 00:00:00 2001 From: yair Date: Wed, 10 Jul 2024 14:04:22 +0300 Subject: [PATCH 6/6] bump --- charts/port-ocean/Chart.yaml | 2 +- charts/port-ocean/README.md | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/charts/port-ocean/Chart.yaml b/charts/port-ocean/Chart.yaml index 0db9bf8..47ad77a 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.3 +version: 0.5.0 appVersion: "0.1.0" home: https://getport.io/ sources: diff --git a/charts/port-ocean/README.md b/charts/port-ocean/README.md index 050f647..38cf177 100644 --- a/charts/port-ocean/README.md +++ b/charts/port-ocean/README.md @@ -58,15 +58,16 @@ The following table lists the configuration parameters of the `port-ocean` chart | `scheduledResyncInterval` | The number in minutes to reschedule and poll data from the 3rd party system. When workload.kind is set to CronJob this parameter is required and should be in a format of a cron string | `null` | | `sendRawDataExamples` | Enable sending raw data examples from the third party API to port for testing and managing the integration mapping | `true` | | `podAnnotations` | Annotations to be added to the pod. | `{}` | -| `podServiceAccount.name` | Service account to attach to the pod. | `null` | +| `podServiceAccount.name` | Service account to attach to the pod. | `null` | | `podSecurityContext` | Security context applied to the pod. | `{}` | | `containerSecurityContext` | Security context applied to the container. | `{}` | | `extraInitContainers` | Additional init containers to be added to the pod. | `[]` | | `workload.kind` | Kind of the workload. Can be either Deployment or CronJob | `Deployment` | | `workload.deployment.rolloutStrategy` | Deployment rollout strategy. | `Recreate` | | `workload.cron.resyncTimeoutMinutes` | Timeout in minutes for the resync cron job. When set to 0 or null, the cron job will not have a timeout. | `60` | -| `workload.cron.resyncOnInstall` | Should the first instllation trigger a resync job. | `true` | +| `workload.cron.resyncOnInstall` | Should the first installation trigger a resync job. | `true` | | `workload.cron.resyncOnUpgrade` | Should the upgrade trigger a resync job. | `true` | +| `workload.cron.suspend` | Should the cron scheduling be enabled | `true` | | `securityContext` | Security context applied to the container. | `{}` | | `resources` | Container resource requests and limits. | `{}` | | `nodeSelector` | NodeSelector applied to the pod. | `{}` |