From 2408308656b1ccedcc06de2acf57e0bf956ad526 Mon Sep 17 00:00:00 2001 From: Matt Searle Date: Tue, 27 Sep 2022 10:06:12 +0100 Subject: [PATCH] fix(image-pull-secrets): use bitnami common helpers for image pull secrets conflict between postgres and dependency track image pull secrets mean you can't use private repositories for both postgres and dependency track images. this standardises to bitnami approach BREAKING CHANGE: re: #183 Signed-off-by: Matt Searle --- charts/dependency-track/templates/_helpers.tpl | 8 ++++++++ charts/dependency-track/templates/backend/deployment.yaml | 4 +--- .../dependency-track/templates/frontend/deployment.yaml | 4 +--- charts/dependency-track/values.yaml | 6 +++++- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/charts/dependency-track/templates/_helpers.tpl b/charts/dependency-track/templates/_helpers.tpl index e349ca7..3cdf500 100644 --- a/charts/dependency-track/templates/_helpers.tpl +++ b/charts/dependency-track/templates/_helpers.tpl @@ -8,6 +8,14 @@ {{- include "common.images.image" ( dict "imageRoot" .Values.frontend.image "global" .Values.global ) -}} {{- end -}} +{{- define "apiserver.image.pullSecrets" -}} +{{- include "common.images.renderPullSecrets" ( dict "images" ( list .Values.apiserver.image ) "context" $ ) -}} +{{- end -}} + +{{- define "frontend.image.pullSecrets" -}} +{{- include "common.images.renderPullSecrets" ( dict "images" ( list .Values.frontend.image ) "context" $ ) -}} +{{- end -}} + {{- define "frontend.labels.standard" -}} {{ include "common.labels.standard" . }} app.kubernetes.io/component: frontend diff --git a/charts/dependency-track/templates/backend/deployment.yaml b/charts/dependency-track/templates/backend/deployment.yaml index 3f7f01a..e5de920 100644 --- a/charts/dependency-track/templates/backend/deployment.yaml +++ b/charts/dependency-track/templates/backend/deployment.yaml @@ -15,9 +15,7 @@ spec: metadata: labels: {{- include "backend.labels.standard" . | nindent 8 }} spec: - {{- with .Values.global.imagePullSecrets }} - imagePullSecrets: {{- toYaml . | nindent 6 }} - {{- end }} + {{ include "frontend.image.pullSecrets" . | nindent 6 }} serviceAccountName: {{ include "common.names.fullname" . }}-apiserver securityContext: {{- toYaml .Values.apiserver.podSecurityContext | nindent 8 }} {{- with .Values.apiserver.initContainers }} diff --git a/charts/dependency-track/templates/frontend/deployment.yaml b/charts/dependency-track/templates/frontend/deployment.yaml index 4e9fefb..f3c0a99 100644 --- a/charts/dependency-track/templates/frontend/deployment.yaml +++ b/charts/dependency-track/templates/frontend/deployment.yaml @@ -11,9 +11,7 @@ spec: metadata: labels: {{- include "frontend.labels.standard" . | nindent 8 }} spec: - {{- with .Values.global.imagePullSecrets }} - imagePullSecrets: {{- toYaml . | nindent 6 }} - {{- end }} + {{- include "frontend.image.pullSecrets" . | nindent 6 }} serviceAccountName: {{ include "common.names.fullname" . }}-frontend securityContext: {{- toYaml .Values.frontend.podSecurityContext | nindent 8 }} containers: diff --git a/charts/dependency-track/values.yaml b/charts/dependency-track/values.yaml index 5416669..79a07c4 100644 --- a/charts/dependency-track/values.yaml +++ b/charts/dependency-track/values.yaml @@ -7,7 +7,7 @@ global: imageRegistry: docker.io # imagePullSecrets: - # - name: "myRegistryKeySecretName" + # - "myRegistryKeySecretName" # -- config of the frontend frontend: @@ -17,6 +17,8 @@ frontend: repository: dependencytrack/frontend tag: 4.4.0 pullPolicy: IfNotPresent + pullSecrets: [] + # - "myRegistryKeySecretName" # https://github.com/DependencyTrack/frontend/issues/60 # configmap: # config: | @@ -95,6 +97,8 @@ apiserver: repository: dependencytrack/apiserver tag: 4.5.0 pullPolicy: IfNotPresent + pullSecrets: [] + # - "myRegistryKeySecretName" env: [] persistentVolume: accessModes: