From 86dec5f05b92c1cac49e64368c8a43916fcec4ef Mon Sep 17 00:00:00 2001 From: Jacky Jiang Date: Tue, 5 Oct 2021 22:30:04 +1100 Subject: [PATCH] Use magda-common for docker image related logic as per ticket: https://github.com/magda-io/magda/issues/3229 --- .gitignore | 2 ++ CHANGES.md | 4 ++++ deploy/magda-ckan-connector/Chart.lock | 6 ++++++ deploy/magda-ckan-connector/Chart.yaml | 6 ++++++ .../magda-ckan-connector/templates/cronjobs.yaml | 14 +++++--------- deploy/magda-ckan-connector/templates/jobs.yaml | 14 +++++--------- 6 files changed, 28 insertions(+), 18 deletions(-) create mode 100644 deploy/magda-ckan-connector/Chart.lock diff --git a/.gitignore b/.gitignore index b54be38..14b3f53 100644 --- a/.gitignore +++ b/.gitignore @@ -50,3 +50,5 @@ magda-tenant-api/lib/ #typescript tsconfig.tsbuildinfo + +deploy/*/charts \ No newline at end of file diff --git a/CHANGES.md b/CHANGES.md index e6189a0..a9e9f0a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,7 @@ +# 1.2.0 + +- Use magda-common for docker image related logic as per ticket: https://github.com/magda-io/magda/issues/3229 + # 1.1.0 - #6 Auto detect fields from CKAN package extra data array diff --git a/deploy/magda-ckan-connector/Chart.lock b/deploy/magda-ckan-connector/Chart.lock new file mode 100644 index 0000000..c6d2aa9 --- /dev/null +++ b/deploy/magda-ckan-connector/Chart.lock @@ -0,0 +1,6 @@ +dependencies: +- name: magda-common + repository: https://charts.magda.io + version: 1.0.0-alpha.3 +digest: sha256:0b1517d2380051d5ef2b5f41610712d3d43bf2c504b9cf91b598b01da5d8f0c3 +generated: "2021-10-05T21:51:57.203569+11:00" diff --git a/deploy/magda-ckan-connector/Chart.yaml b/deploy/magda-ckan-connector/Chart.yaml index 6ea64ec..41b7612 100644 --- a/deploy/magda-ckan-connector/Chart.yaml +++ b/deploy/magda-ckan-connector/Chart.yaml @@ -5,3 +5,9 @@ version: "1.1.0" kubeVersion: ">= 1.14.0-0" home: "https://github.com/magda-io/magda-ckan-connector" sources: [ "https://github.com/magda-io/magda-ckan-connector" ] +annotations: + magdaModuleType: "connector" +dependencies: + - name: magda-common + version: "1.0.0-alpha.3" + repository: "https://charts.magda.io" \ No newline at end of file diff --git a/deploy/magda-ckan-connector/templates/cronjobs.yaml b/deploy/magda-ckan-connector/templates/cronjobs.yaml index 20409e6..60d2279 100644 --- a/deploy/magda-ckan-connector/templates/cronjobs.yaml +++ b/deploy/magda-ckan-connector/templates/cronjobs.yaml @@ -17,18 +17,14 @@ spec: metadata: name: connector-{{ .Values.config.id }} spec: -{{- /* -See chart value file for details of the logic used to generate this setting value below.!!! -*/}} -{{- $imagePullSecret := (ne (.Values.image.imagePullSecret | typeOf) "") | ternary .Values.image.imagePullSecret ( (ne (.Values.global.connectors.image.imagePullSecret | typeOf) "") | ternary .Values.global.connectors.image.imagePullSecret ( (ne (.Values.global.image.imagePullSecret | typeOf) "") | ternary .Values.global.image.imagePullSecret .Values.defaultImage.imagePullSecret ) ) -}} - {{- if ne ($imagePullSecret | toString) "false" }} - imagePullSecrets: - - name: {{ $imagePullSecret }} + {{- $imagePullSecrets := include "magda.imagePullSecrets" . }} + {{- if $imagePullSecrets | empty | not }} +{{ $imagePullSecret | indent 10 }} {{- end }} containers: - name: connector-{{ .Values.config.id }} - image: "{{ .Values.image.repository | default .Values.global.connectors.image.repository | default .Values.global.image.repository | default .Values.defaultImage.repository }}/{{ .Values.image.name }}:{{ .Values.image.tag | default .Values.global.connectors.image.tag | default .Values.global.image.tag | default .Chart.Version }}" - imagePullPolicy: {{ .Values.image.pullPolicy | default .Values.global.connectors.image.pullPolicy | default .Values.global.image.pullPolicy | default .Values.defaultImage.pullPolicy }} + image: {{ include "magda.image" . | quote }} + imagePullPolicy: {{ include "magda.imagePullPolicy" . | quote }} command: - "node" - "/usr/src/app/component/dist/index.js" diff --git a/deploy/magda-ckan-connector/templates/jobs.yaml b/deploy/magda-ckan-connector/templates/jobs.yaml index e9378d8..db7bad6 100644 --- a/deploy/magda-ckan-connector/templates/jobs.yaml +++ b/deploy/magda-ckan-connector/templates/jobs.yaml @@ -13,18 +13,14 @@ spec: metadata: name: connector-{{ .Values.config.id }} spec: -{{- /* -See chart value file for details of the logic used to generate this setting value below.!!! -*/}} -{{- $imagePullSecret := (ne (.Values.image.imagePullSecret | typeOf) "") | ternary .Values.image.imagePullSecret ( (ne (.Values.global.connectors.image.imagePullSecret | typeOf) "") | ternary .Values.global.connectors.image.imagePullSecret ( (ne (.Values.global.image.imagePullSecret | typeOf) "") | ternary .Values.global.image.imagePullSecret .Values.defaultImage.imagePullSecret ) ) -}} - {{- if ne ($imagePullSecret | toString) "false" }} - imagePullSecrets: - - name: {{ $imagePullSecret }} + {{- $imagePullSecrets := include "magda.imagePullSecrets" . }} + {{- if $imagePullSecrets | empty | not }} +{{ $imagePullSecret | indent 6 }} {{- end }} containers: - name: connector-{{ .Values.config.id }} - image: "{{ .Values.image.repository | default .Values.global.connectors.image.repository | default .Values.global.image.repository | default .Values.defaultImage.repository }}/{{ .Values.image.name }}:{{ .Values.image.tag | default .Values.global.connectors.image.tag | default .Values.global.image.tag | default .Chart.Version }}" - imagePullPolicy: {{ .Values.image.pullPolicy | default .Values.global.connectors.image.pullPolicy | default .Values.global.image.pullPolicy | default .Values.defaultImage.pullPolicy }} + image: {{ include "magda.image" . | quote }} + imagePullPolicy: {{ include "magda.imagePullPolicy" . | quote }} command: - "node" - "/usr/src/app/component/dist/index.js"