Skip to content

Commit

Permalink
fix(image-pull-secrets): use bitnami common helpers for image pull se…
Browse files Browse the repository at this point in the history
…crets

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: evryfs#183

Signed-off-by: Matt Searle <[email protected]>
  • Loading branch information
Matt Searle committed Oct 10, 2022
1 parent 2de6494 commit 2408308
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
8 changes: 8 additions & 0 deletions charts/dependency-track/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions charts/dependency-track/templates/backend/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
4 changes: 1 addition & 3 deletions charts/dependency-track/templates/frontend/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 5 additions & 1 deletion charts/dependency-track/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
global:
imageRegistry: docker.io
# imagePullSecrets:
# - name: "myRegistryKeySecretName"
# - "myRegistryKeySecretName"

# -- config of the frontend
frontend:
Expand All @@ -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: |
Expand Down Expand Up @@ -95,6 +97,8 @@ apiserver:
repository: dependencytrack/apiserver
tag: 4.5.0
pullPolicy: IfNotPresent
pullSecrets: []
# - "myRegistryKeySecretName"
env: []
persistentVolume:
accessModes:
Expand Down

0 comments on commit 2408308

Please sign in to comment.