From 8c4485371a3eb437ffe25a96f2eda048d5f695ab Mon Sep 17 00:00:00 2001 From: Jacky Jiang Date: Tue, 12 Oct 2021 20:21:38 +1100 Subject: [PATCH] Related to https://github.com/magda-io/magda/issues/3229, Use magda-common for docker image related logic --- .gitignore | 2 ++ .helmdocsignore | 1 + CHANGES.md | 5 +++++ deploy/magda-minion-broken-link/Chart.lock | 6 ++++++ deploy/magda-minion-broken-link/Chart.yaml | 7 ++++++- .../magda-minion-broken-link/templates/cronjob.yaml | 7 ++++--- .../templates/deployment.yaml | 13 +++---------- deploy/magda-minion-broken-link/values.yaml | 10 +++++++--- 8 files changed, 34 insertions(+), 17 deletions(-) create mode 100644 .helmdocsignore create mode 100644 CHANGES.md create mode 100644 deploy/magda-minion-broken-link/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/.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 new file mode 100644 index 0000000..a96e2c0 --- /dev/null +++ b/CHANGES.md @@ -0,0 +1,5 @@ +# 1.0.0 + +- Upgrade dependencies +- Upgrade CI scripts +- Related to https://github.com/magda-io/magda/issues/3229, Use magda-common for docker image related logic diff --git a/deploy/magda-minion-broken-link/Chart.lock b/deploy/magda-minion-broken-link/Chart.lock new file mode 100644 index 0000000..0183b51 --- /dev/null +++ b/deploy/magda-minion-broken-link/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-12T20:12:30.701077+11:00" diff --git a/deploy/magda-minion-broken-link/Chart.yaml b/deploy/magda-minion-broken-link/Chart.yaml index 25e805e..126311e 100644 --- a/deploy/magda-minion-broken-link/Chart.yaml +++ b/deploy/magda-minion-broken-link/Chart.yaml @@ -5,4 +5,9 @@ version: "0.0.57-0" kubeVersion: ">= 1.14.0-0" home: "https://github.com/magda-io/magda-minion-broken-link" sources: ["https://github.com/magda-io/magda-minion-broken-link"] - +annotations: + magdaModuleType: "minion" +dependencies: + - name: magda-common + version: "1.0.0-alpha.4" + repository: "https://charts.magda.io" diff --git a/deploy/magda-minion-broken-link/templates/cronjob.yaml b/deploy/magda-minion-broken-link/templates/cronjob.yaml index 42a56d5..2602265 100644 --- a/deploy/magda-minion-broken-link/templates/cronjob.yaml +++ b/deploy/magda-minion-broken-link/templates/cronjob.yaml @@ -16,10 +16,11 @@ spec: labels: cron: minion-broken-link-recrawl spec: + {{- include "magda.imagePullSecrets" (dict "image" .Values.cronJobImage) | indent 10 }} containers: - - image: "alpine" - imagePullPolicy: IfNotPresent - name: minion-broken-link-recrawl + - name: minion-broken-link-recrawl + image: {{ include "magda.image" (dict "image" .Values.cronJobImage) | quote }} + imagePullPolicy: {{ include "magda.imagePullPolicy" (dict "image" .Values.cronJobImage) | quote }} command: - "/bin/sh" - "-c" diff --git a/deploy/magda-minion-broken-link/templates/deployment.yaml b/deploy/magda-minion-broken-link/templates/deployment.yaml index fb25026..3fd3212 100644 --- a/deploy/magda-minion-broken-link/templates/deployment.yaml +++ b/deploy/magda-minion-broken-link/templates/deployment.yaml @@ -15,18 +15,11 @@ spec: labels: service: minion-broken-link 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.minions.image.imagePullSecret | typeOf) "") | ternary .Values.global.minions.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: minion-broken-link - image: "{{ .Values.image.repository | default .Values.global.minions.image.repository | default .Values.global.image.repository | default .Values.defaultImage.repository }}/{{ .Values.image.name }}:{{ .Values.image.tag | default .Values.global.minions.image.tag | default .Values.global.image.tag | default .Values.defaultImage.tag }}" - imagePullPolicy: {{ .Values.image.pullPolicy | default .Values.global.minions.image.pullPolicy | default .Values.global.image.pullPolicy | default .Values.defaultImage.pullPolicy }} + image: {{ include "magda.image" . | quote }} + imagePullPolicy: {{ include "magda.imagePullPolicy" . | quote }} {{- if .Values.global.enableLivenessProbes }} livenessProbe: httpGet: diff --git a/deploy/magda-minion-broken-link/values.yaml b/deploy/magda-minion-broken-link/values.yaml index c9b5d6a..f723f61 100644 --- a/deploy/magda-minion-broken-link/values.yaml +++ b/deploy/magda-minion-broken-link/values.yaml @@ -7,20 +7,24 @@ global: # image setting loadding order: (from higher priority to lower priority) # - Values.image.x # - Values.global.minions.image.x -# - Values.global.image.x # - Values.defaultImage.x # You can set `imagePullSecret` value to `false` (bool) to reset the value (see example below) image: name: "magda-minion-broken-link" # repository: - # tag: # pullPolicy: # imagePullSecret: +cronJobImage: + name: "alpine" + repository: "docker.io" + tag: "latest" + pullPolicy: IfNotPresent + pullSecrets: false + defaultImage: repository: docker.io/data61 - tag: 0.0.57-0 pullPolicy: IfNotPresent imagePullSecret: false