From 7d13fb1430aa33fcd26991e788d44bc3721288e9 Mon Sep 17 00:00:00 2001 From: yaelibarg Date: Tue, 18 Nov 2025 11:18:51 +0200 Subject: [PATCH 1/4] feat: Add support for custom container image name in port-ocean chart - Introduced `imageName` field in values.yaml to allow users to specify a custom container image name. - Added a helper function to generate the default image name based on integration type and version. - Updated deployment templates to utilize the new `imageName` field, falling back to the default if not provided. --- charts/port-ocean/templates/_helpers.tpl | 7 +++++++ .../port-ocean/templates/actions-processor/deployment.yaml | 2 +- charts/port-ocean/templates/cron-job/cron.yaml | 2 +- charts/port-ocean/templates/deployment-live-events.yaml | 2 +- charts/port-ocean/templates/deployment.yaml | 2 +- charts/port-ocean/values.yaml | 5 +++++ 6 files changed, 16 insertions(+), 4 deletions(-) diff --git a/charts/port-ocean/templates/_helpers.tpl b/charts/port-ocean/templates/_helpers.tpl index f2b395a..336b108 100644 --- a/charts/port-ocean/templates/_helpers.tpl +++ b/charts/port-ocean/templates/_helpers.tpl @@ -179,6 +179,13 @@ Get container name {{- printf "%s-container" $prefix }} {{- end }} +{{/* +Get default image name +*/}} +{{- define "port-ocean.defaultImageName" -}} +port-ocean-{{ .Values.integration.type }}:{{ .Values.integration.version | default "latest" }} +{{- end }} + {{/* Get deployment name */}} diff --git a/charts/port-ocean/templates/actions-processor/deployment.yaml b/charts/port-ocean/templates/actions-processor/deployment.yaml index 1b301e8..a23ce69 100644 --- a/charts/port-ocean/templates/actions-processor/deployment.yaml +++ b/charts/port-ocean/templates/actions-processor/deployment.yaml @@ -44,7 +44,7 @@ spec: containers: - name: {{ include "port-ocean.containerName" . }} imagePullPolicy: {{ .Values.imagePullPolicy }} - image: '{{ .Values.imageRegistry }}/port-ocean-{{ .Values.integration.type }}:{{ .Values.integration.version | default "latest" }}' + image: '{{ .Values.imageRegistry }}/{{ .Values.imageName | default (include "port-ocean.defaultImageName" .) }}' {{- if .Values.service.enabled }} securityContext: {{- if .Values.containerSecurityContext }} diff --git a/charts/port-ocean/templates/cron-job/cron.yaml b/charts/port-ocean/templates/cron-job/cron.yaml index 2919199..4a547e1 100644 --- a/charts/port-ocean/templates/cron-job/cron.yaml +++ b/charts/port-ocean/templates/cron-job/cron.yaml @@ -132,7 +132,7 @@ spec: containers: - name: {{ include "port-ocean.containerName" . }} imagePullPolicy: {{ .Values.imagePullPolicy }} - image: '{{ .Values.imageRegistry }}/port-ocean-{{ .Values.integration.type }}:{{ .Values.integration.version | default "latest" }}' + image: '{{ .Values.imageRegistry }}/{{ .Values.imageName | default (include "port-ocean.defaultImageName" .) }}' {{- if .Values.service.enabled }} securityContext: {{- if .Values.containerSecurityContext }} diff --git a/charts/port-ocean/templates/deployment-live-events.yaml b/charts/port-ocean/templates/deployment-live-events.yaml index 248ed52..f5bee71 100644 --- a/charts/port-ocean/templates/deployment-live-events.yaml +++ b/charts/port-ocean/templates/deployment-live-events.yaml @@ -57,7 +57,7 @@ spec: containers: - name: {{ include "port-ocean.containerName" . }} imagePullPolicy: {{ .Values.imagePullPolicy }} - image: '{{ .Values.imageRegistry }}/port-ocean-{{ .Values.integration.type }}:{{ .Values.integration.version | default "latest" }}' + image: '{{ .Values.imageRegistry }}/{{ .Values.imageName | default (include "port-ocean.defaultImageName" .) }}' {{- if .Values.service.enabled }} securityContext: {{- if .Values.containerSecurityContext }} diff --git a/charts/port-ocean/templates/deployment.yaml b/charts/port-ocean/templates/deployment.yaml index a406d05..daa1dbc 100644 --- a/charts/port-ocean/templates/deployment.yaml +++ b/charts/port-ocean/templates/deployment.yaml @@ -55,7 +55,7 @@ spec: containers: - name: {{ include "port-ocean.containerName" . }} imagePullPolicy: {{ .Values.imagePullPolicy }} - image: '{{ .Values.imageRegistry }}/port-ocean-{{ .Values.integration.type }}:{{ .Values.integration.version | default "latest" }}' + image: '{{ .Values.imageRegistry }}/{{ .Values.imageName | default (include "port-ocean.defaultImageName" .) }}' {{- if .Values.service.enabled }} securityContext: {{- if .Values.containerSecurityContext }} diff --git a/charts/port-ocean/values.yaml b/charts/port-ocean/values.yaml index bb3806d..21f9662 100644 --- a/charts/port-ocean/values.yaml +++ b/charts/port-ocean/values.yaml @@ -78,6 +78,11 @@ extraLabels: { } imageRegistry: "ghcr.io/port-labs" +# imageName: Custom container image name (without registry, but including tag) +# If not specified, defaults to "port-ocean-{integration.type}:{integration.version}" +# Example: "my-custom-ocean-image:v1.0.0" or "port-ocean-custom:latest" +imageName: "" + imagePullPolicy: Always imagePullSecrets: [ ] From 20d1ad6e763c844dbcf81409a8c7580d058e0359 Mon Sep 17 00:00:00 2001 From: yaelibarg Date: Tue, 18 Nov 2025 11:27:58 +0200 Subject: [PATCH 2/4] refactor: Rename imageName to image in port-ocean chart - Updated values.yaml to change `imageName` field to `image` for clarity. - Modified helper function to reflect the new image naming convention. - Adjusted deployment templates to use the updated `image` field, ensuring backward compatibility with default image generation. --- charts/port-ocean/templates/_helpers.tpl | 4 ++-- charts/port-ocean/templates/actions-processor/deployment.yaml | 2 +- charts/port-ocean/templates/cron-job/cron.yaml | 2 +- charts/port-ocean/templates/deployment-live-events.yaml | 2 +- charts/port-ocean/templates/deployment.yaml | 2 +- charts/port-ocean/values.yaml | 4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/charts/port-ocean/templates/_helpers.tpl b/charts/port-ocean/templates/_helpers.tpl index 336b108..9b30b7a 100644 --- a/charts/port-ocean/templates/_helpers.tpl +++ b/charts/port-ocean/templates/_helpers.tpl @@ -180,9 +180,9 @@ Get container name {{- end }} {{/* -Get default image name +Get default image */}} -{{- define "port-ocean.defaultImageName" -}} +{{- define "port-ocean.defaultImage" -}} port-ocean-{{ .Values.integration.type }}:{{ .Values.integration.version | default "latest" }} {{- end }} diff --git a/charts/port-ocean/templates/actions-processor/deployment.yaml b/charts/port-ocean/templates/actions-processor/deployment.yaml index a23ce69..9ffee0e 100644 --- a/charts/port-ocean/templates/actions-processor/deployment.yaml +++ b/charts/port-ocean/templates/actions-processor/deployment.yaml @@ -44,7 +44,7 @@ spec: containers: - name: {{ include "port-ocean.containerName" . }} imagePullPolicy: {{ .Values.imagePullPolicy }} - image: '{{ .Values.imageRegistry }}/{{ .Values.imageName | default (include "port-ocean.defaultImageName" .) }}' + image: '{{ .Values.imageRegistry }}/{{ .Values.image | default (include "port-ocean.defaultImage" .) }}' {{- if .Values.service.enabled }} securityContext: {{- if .Values.containerSecurityContext }} diff --git a/charts/port-ocean/templates/cron-job/cron.yaml b/charts/port-ocean/templates/cron-job/cron.yaml index 4a547e1..62ad0b2 100644 --- a/charts/port-ocean/templates/cron-job/cron.yaml +++ b/charts/port-ocean/templates/cron-job/cron.yaml @@ -132,7 +132,7 @@ spec: containers: - name: {{ include "port-ocean.containerName" . }} imagePullPolicy: {{ .Values.imagePullPolicy }} - image: '{{ .Values.imageRegistry }}/{{ .Values.imageName | default (include "port-ocean.defaultImageName" .) }}' + image: '{{ .Values.imageRegistry }}/{{ .Values.image | default (include "port-ocean.defaultImage" .) }}' {{- if .Values.service.enabled }} securityContext: {{- if .Values.containerSecurityContext }} diff --git a/charts/port-ocean/templates/deployment-live-events.yaml b/charts/port-ocean/templates/deployment-live-events.yaml index f5bee71..c6d6bc1 100644 --- a/charts/port-ocean/templates/deployment-live-events.yaml +++ b/charts/port-ocean/templates/deployment-live-events.yaml @@ -57,7 +57,7 @@ spec: containers: - name: {{ include "port-ocean.containerName" . }} imagePullPolicy: {{ .Values.imagePullPolicy }} - image: '{{ .Values.imageRegistry }}/{{ .Values.imageName | default (include "port-ocean.defaultImageName" .) }}' + image: '{{ .Values.imageRegistry }}/{{ .Values.image | default (include "port-ocean.defaultImage" .) }}' {{- if .Values.service.enabled }} securityContext: {{- if .Values.containerSecurityContext }} diff --git a/charts/port-ocean/templates/deployment.yaml b/charts/port-ocean/templates/deployment.yaml index daa1dbc..34b4a4c 100644 --- a/charts/port-ocean/templates/deployment.yaml +++ b/charts/port-ocean/templates/deployment.yaml @@ -55,7 +55,7 @@ spec: containers: - name: {{ include "port-ocean.containerName" . }} imagePullPolicy: {{ .Values.imagePullPolicy }} - image: '{{ .Values.imageRegistry }}/{{ .Values.imageName | default (include "port-ocean.defaultImageName" .) }}' + image: '{{ .Values.imageRegistry }}/{{ .Values.image | default (include "port-ocean.defaultImage" .) }}' {{- if .Values.service.enabled }} securityContext: {{- if .Values.containerSecurityContext }} diff --git a/charts/port-ocean/values.yaml b/charts/port-ocean/values.yaml index 21f9662..e749497 100644 --- a/charts/port-ocean/values.yaml +++ b/charts/port-ocean/values.yaml @@ -78,10 +78,10 @@ extraLabels: { } imageRegistry: "ghcr.io/port-labs" -# imageName: Custom container image name (without registry, but including tag) +# image: Custom container image name (without registry, but including tag) # If not specified, defaults to "port-ocean-{integration.type}:{integration.version}" # Example: "my-custom-ocean-image:v1.0.0" or "port-ocean-custom:latest" -imageName: "" +image: "" imagePullPolicy: Always From 2e192a9ba1439de11611f79e111347dde5efca1d Mon Sep 17 00:00:00 2001 From: yaelibarg Date: Tue, 18 Nov 2025 12:11:47 +0200 Subject: [PATCH 3/4] refactor: Simplify image reference in port-ocean chart - Introduced a new helper function to standardize the container image retrieval process. - Updated deployment and cron job templates to utilize the new helper function for image definition, enhancing maintainability and clarity. --- charts/port-ocean/templates/_helpers.tpl | 7 +++++++ .../port-ocean/templates/actions-processor/deployment.yaml | 2 +- charts/port-ocean/templates/cron-job/cron.yaml | 2 +- charts/port-ocean/templates/deployment-live-events.yaml | 2 +- charts/port-ocean/templates/deployment.yaml | 2 +- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/charts/port-ocean/templates/_helpers.tpl b/charts/port-ocean/templates/_helpers.tpl index 9b30b7a..bea619c 100644 --- a/charts/port-ocean/templates/_helpers.tpl +++ b/charts/port-ocean/templates/_helpers.tpl @@ -186,6 +186,13 @@ Get default image port-ocean-{{ .Values.integration.type }}:{{ .Values.integration.version | default "latest" }} {{- end }} +{{/* +Get container image (registry + image name) +*/}} +{{- define "port-ocean.image" -}} +{{ .Values.imageRegistry }}/{{ .Values.image | default (include "port-ocean.defaultImage" .) }} +{{- end }} + {{/* Get deployment name */}} diff --git a/charts/port-ocean/templates/actions-processor/deployment.yaml b/charts/port-ocean/templates/actions-processor/deployment.yaml index 9ffee0e..3607fb2 100644 --- a/charts/port-ocean/templates/actions-processor/deployment.yaml +++ b/charts/port-ocean/templates/actions-processor/deployment.yaml @@ -44,7 +44,7 @@ spec: containers: - name: {{ include "port-ocean.containerName" . }} imagePullPolicy: {{ .Values.imagePullPolicy }} - image: '{{ .Values.imageRegistry }}/{{ .Values.image | default (include "port-ocean.defaultImage" .) }}' + image: {{ include "port-ocean.image" . }} {{- if .Values.service.enabled }} securityContext: {{- if .Values.containerSecurityContext }} diff --git a/charts/port-ocean/templates/cron-job/cron.yaml b/charts/port-ocean/templates/cron-job/cron.yaml index 62ad0b2..b031d93 100644 --- a/charts/port-ocean/templates/cron-job/cron.yaml +++ b/charts/port-ocean/templates/cron-job/cron.yaml @@ -132,7 +132,7 @@ spec: containers: - name: {{ include "port-ocean.containerName" . }} imagePullPolicy: {{ .Values.imagePullPolicy }} - image: '{{ .Values.imageRegistry }}/{{ .Values.image | default (include "port-ocean.defaultImage" .) }}' + image: {{ include "port-ocean.image" . }} {{- if .Values.service.enabled }} securityContext: {{- if .Values.containerSecurityContext }} diff --git a/charts/port-ocean/templates/deployment-live-events.yaml b/charts/port-ocean/templates/deployment-live-events.yaml index c6d6bc1..471ae41 100644 --- a/charts/port-ocean/templates/deployment-live-events.yaml +++ b/charts/port-ocean/templates/deployment-live-events.yaml @@ -57,7 +57,7 @@ spec: containers: - name: {{ include "port-ocean.containerName" . }} imagePullPolicy: {{ .Values.imagePullPolicy }} - image: '{{ .Values.imageRegistry }}/{{ .Values.image | default (include "port-ocean.defaultImage" .) }}' + image: {{ include "port-ocean.image" . }} {{- if .Values.service.enabled }} securityContext: {{- if .Values.containerSecurityContext }} diff --git a/charts/port-ocean/templates/deployment.yaml b/charts/port-ocean/templates/deployment.yaml index 34b4a4c..a97fa13 100644 --- a/charts/port-ocean/templates/deployment.yaml +++ b/charts/port-ocean/templates/deployment.yaml @@ -55,7 +55,7 @@ spec: containers: - name: {{ include "port-ocean.containerName" . }} imagePullPolicy: {{ .Values.imagePullPolicy }} - image: '{{ .Values.imageRegistry }}/{{ .Values.image | default (include "port-ocean.defaultImage" .) }}' + image: {{ include "port-ocean.image" . }} {{- if .Values.service.enabled }} securityContext: {{- if .Values.containerSecurityContext }} From 68604ed30205f69447f7e4853115e5d6c4c943a5 Mon Sep 17 00:00:00 2001 From: yaelibarg Date: Tue, 18 Nov 2025 12:14:58 +0200 Subject: [PATCH 4/4] chore: Bump port-ocean chart version to 0.11.1 --- 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 7d5694d..77948af 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.11.0 +version: 0.11.1 appVersion: "0.1.0" home: https://getport.io/ sources: