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/.helmdocsignore b/.helmdocsignore new file mode 100644 index 0000000..dd512bf --- /dev/null +++ b/.helmdocsignore @@ -0,0 +1 @@ +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/README.md b/README.md index 5b3c940..7bfd082 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,10 @@ Development releases (per commit) are also available from [GitHub Registry](http Kubernetes: `>= 1.14.0-0` +| Repository | Name | Version | +| ----------------------- | ------------ | ------------- | +| https://charts.magda.io | magda-common | 1.0.0-alpha.4 | + ## Values | Key | Type | Default | Description | diff --git a/deploy/magda-ckan-connector/Chart.lock b/deploy/magda-ckan-connector/Chart.lock new file mode 100644 index 0000000..e5d80c7 --- /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.4 +digest: sha256:a5dcf2df16ca5a3972f92d91434c2e78be0ce411994d2a3cb89c674a711ddc24 +generated: "2021-10-10T16:46:28.537677+11:00" diff --git a/deploy/magda-ckan-connector/Chart.yaml b/deploy/magda-ckan-connector/Chart.yaml index 6ea64ec..c18ba96 100644 --- a/deploy/magda-ckan-connector/Chart.yaml +++ b/deploy/magda-ckan-connector/Chart.yaml @@ -1,7 +1,13 @@ apiVersion: v2 name: magda-ckan-connector description: A Helm chart for Magda Ckan Connector -version: "1.1.0" +version: "1.2.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.4" + repository: "https://charts.magda.io" diff --git a/deploy/magda-ckan-connector/templates/cronjobs.yaml b/deploy/magda-ckan-connector/templates/cronjobs.yaml index 20409e6..f37cf24 100644 --- a/deploy/magda-ckan-connector/templates/cronjobs.yaml +++ b/deploy/magda-ckan-connector/templates/cronjobs.yaml @@ -17,18 +17,11 @@ 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 }} - {{- end }} + {{- include "magda.imagePullSecrets" . | indent 10 }} 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/functionDataUrlProcessor.yaml b/deploy/magda-ckan-connector/templates/functionDataUrlProcessor.yaml index a3a8b84..c3cb84f 100644 --- a/deploy/magda-ckan-connector/templates/functionDataUrlProcessor.yaml +++ b/deploy/magda-ckan-connector/templates/functionDataUrlProcessor.yaml @@ -15,7 +15,7 @@ metadata: spec: name: ckan-data-url-processor handler: node bootstrap.js - 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 }}" + image: {{ include "magda.image" . | quote }} labels: magdaCategory: connectors magdaSubCategory: ckan-connector @@ -30,6 +30,13 @@ spec: write_timeout: 65s exec_timeout: 60s userId: 00000000-0000-4000-8000-000000000000 + {{- $pullSecrets := include "magda.image.getConsolidatedPullSecretList" . | mustFromJson }} + {{- if (not (empty $pullSecrets)) }} + secrets: + {{- range $pullSecrets }} + - {{ . | quote }} + {{- end }} + {{- end }} {{ .Values.resources | toYaml | indent 2 -}} {{- end }} {{- end }} diff --git a/deploy/magda-ckan-connector/templates/jobs.yaml b/deploy/magda-ckan-connector/templates/jobs.yaml index e9378d8..2fc4238 100644 --- a/deploy/magda-ckan-connector/templates/jobs.yaml +++ b/deploy/magda-ckan-connector/templates/jobs.yaml @@ -13,18 +13,11 @@ 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 }} - {{- end }} + {{- include "magda.imagePullSecrets" . | indent 6 }} 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/values.yaml b/deploy/magda-ckan-connector/values.yaml index 1ba5841..f0b2d46 100644 --- a/deploy/magda-ckan-connector/values.yaml +++ b/deploy/magda-ckan-connector/values.yaml @@ -7,7 +7,6 @@ global: # image setting loadding order: (from higher priority to lower priority) # - Values.image.x # - Values.global.connectors.image.x -# - Values.global.image.x # - Values.defaultImage.x # You can set `imagePullSecret` value to `false` (bool) to reset the value (see example below) @@ -59,7 +58,7 @@ config: ## The base URL of the place to source data from sourceUrl: "https://data.gov.au/data/" ## When crawling through from beginning to end, how big should the individual requests be in records? - pageSize: 1000 + pageSize: 100 ## Crontab schedule for how often this should happen. # default = "0 14 * * 6" i.e. 12am Sydney time on Sunday diff --git a/package.json b/package.json index 264be90..2c44a9b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@magda/ckan-connector", "description": "MAGDA CKAN Connector", - "version": "1.1.0", + "version": "1.2.0", "scripts": { "prebuild": "rimraf dist tsconfig.tsbuildinfo", "build": "yarn run compile",