Skip to content

Commit

Permalink
Merge pull request #8 from magda-io/use-magda-common
Browse files Browse the repository at this point in the history
Use magda-common chart for for docker image related logic
  • Loading branch information
t83714 committed Oct 11, 2021
2 parents ca63bdf + 096e175 commit 5cf8c04
Show file tree
Hide file tree
Showing 11 changed files with 40 additions and 25 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,5 @@ magda-tenant-api/lib/

#typescript
tsconfig.tsbuildinfo

deploy/*/charts
1 change: 1 addition & 0 deletions .helmdocsignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
deploy/*/charts
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
6 changes: 6 additions & 0 deletions deploy/magda-ckan-connector/Chart.lock
Original file line number Diff line number Diff line change
@@ -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"
8 changes: 7 additions & 1 deletion deploy/magda-ckan-connector/Chart.yaml
Original file line number Diff line number Diff line change
@@ -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"
13 changes: 3 additions & 10 deletions deploy/magda-ckan-connector/templates/cronjobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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) "<nil>") | ternary .Values.image.imagePullSecret ( (ne (.Values.global.connectors.image.imagePullSecret | typeOf) "<nil>") | ternary .Values.global.connectors.image.imagePullSecret ( (ne (.Values.global.image.imagePullSecret | typeOf) "<nil>") | 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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
13 changes: 3 additions & 10 deletions deploy/magda-ckan-connector/templates/jobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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) "<nil>") | ternary .Values.image.imagePullSecret ( (ne (.Values.global.connectors.image.imagePullSecret | typeOf) "<nil>") | ternary .Values.global.connectors.image.imagePullSecret ( (ne (.Values.global.image.imagePullSecret | typeOf) "<nil>") | 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"
Expand Down
3 changes: 1 addition & 2 deletions deploy/magda-ckan-connector/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit 5cf8c04

Please sign in to comment.