Skip to content
Snippets Groups Projects
Commit 8bcbf891 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-3328 refactor imagePullSecret

parent 2d0195b4
No related branches found
No related tags found
No related merge requests found
...@@ -22,12 +22,6 @@ app.kubernetes.io/name: {{ .Release.Name }} ...@@ -22,12 +22,6 @@ app.kubernetes.io/name: {{ .Release.Name }}
app.kubernetes.io/namespace: {{ include "app.namespace" . }} app.kubernetes.io/namespace: {{ include "app.namespace" . }}
{{- end -}} {{- end -}}
{{- define "app.imagePullSecret" }}
{{- with .Values.imageCredentials }}
{{- printf "{\"auths\":{\"%s\":{\"username\":\"%s\",\"password\":\"%s\",\"email\":\"%s\",\"auth\":\"%s\"}}}" .registry .username .password .email (printf "%s:%s" .username .password | b64enc) | b64enc }}
{{- end }}
{{- end }}
{{- define "app.nameToIdentifier" -}} {{- define "app.nameToIdentifier" -}}
{{- trimAll "-" ( regexReplaceAll "[^a-zA-Z0-9-]" (lower .) "" ) | trunc 20 }} {{- trimAll "-" ( regexReplaceAll "[^a-zA-Z0-9-]" (lower .) "" ) | trunc 20 }}
{{- end -}} {{- end -}}
......
...@@ -145,7 +145,7 @@ spec: ...@@ -145,7 +145,7 @@ spec:
dnsConfig: {} dnsConfig: {}
dnsPolicy: ClusterFirst dnsPolicy: ClusterFirst
imagePullSecrets: imagePullSecrets:
- name: {{ .Values.imagePullSecret | default "administration-image-pull-secret" }} - name: {{ required "image-pull-secret must be set" .Values.imagePullSecret }}
restartPolicy: Always restartPolicy: Always
schedulerName: default-scheduler schedulerName: default-scheduler
securityContext: {} securityContext: {}
......
...@@ -45,3 +45,4 @@ sso: ...@@ -45,3 +45,4 @@ sso:
client_roles: client_roles:
- ROLE_DUMMY - ROLE_DUMMY
imagePullSecret: image-pull-secret
\ No newline at end of file
...@@ -34,6 +34,7 @@ set: ...@@ -34,6 +34,7 @@ set:
bezeichner: helm bezeichner: helm
sso: sso:
serverUrl: https://sso.company.local serverUrl: https://sso.company.local
imagePullSecret: image-pull-secret
tests: tests:
- it: should have a volume for the mongodb certificate - it: should have a volume for the mongodb certificate
asserts: asserts:
......
...@@ -34,7 +34,7 @@ set: ...@@ -34,7 +34,7 @@ set:
bezeichner: helm bezeichner: helm
sso: sso:
serverUrl: https://sso.company.local serverUrl: https://sso.company.local
imagePullSecret: image-pull-secret
tests: tests:
- it: check metadata.labels - it: check metadata.labels
asserts: asserts:
......
...@@ -36,6 +36,7 @@ set: ...@@ -36,6 +36,7 @@ set:
bezeichner: helm bezeichner: helm
sso: sso:
serverUrl: https://sso.company.local serverUrl: https://sso.company.local
imagePullSecret: image-pull-secret
tests: tests:
- it: check default values - it: check default values
asserts: asserts:
......
...@@ -34,17 +34,15 @@ set: ...@@ -34,17 +34,15 @@ set:
sso: sso:
serverUrl: https://sso.company.local serverUrl: https://sso.company.local
tests: tests:
- it: should use default image pull secret - it: should set image pull secret
asserts:
- contains:
path: spec.template.spec.imagePullSecrets
content:
name: administration-image-pull-secret
- it: should use customizable image pull secret
set: set:
imagePullSecret: custom-image-pull-secret imagePullSecret: image-pull-secret
asserts: asserts:
- contains: - contains:
path: spec.template.spec.imagePullSecrets path: spec.template.spec.imagePullSecrets
content: content:
name: custom-image-pull-secret name: image-pull-secret
- it: should fail template when image pull secret not set
asserts:
- failedTemplate:
errormessage: image-pull-secret must be set
...@@ -33,6 +33,7 @@ set: ...@@ -33,6 +33,7 @@ set:
bezeichner: helm bezeichner: helm
sso: sso:
serverUrl: https://sso.company.local serverUrl: https://sso.company.local
imagePullSecret: image-pull-secret
tests: tests:
- it: should have customizable resources - it: should have customizable resources
set: set:
......
...@@ -34,6 +34,7 @@ set: ...@@ -34,6 +34,7 @@ set:
bezeichner: helm bezeichner: helm
sso: sso:
serverUrl: https://sso.company.local serverUrl: https://sso.company.local
imagePullSecret: image-pull-secret
tests: tests:
- it: should override the spring profiles - it: should override the spring profiles
set: set:
......
...@@ -34,6 +34,7 @@ set: ...@@ -34,6 +34,7 @@ set:
bezeichner: helm bezeichner: helm
sso: sso:
serverUrl: https://sso.company.local serverUrl: https://sso.company.local
imagePullSecret: image-pull-secret
tests: tests:
- it: should have metadata values - it: should have metadata values
asserts: asserts:
...@@ -96,9 +97,6 @@ tests: ...@@ -96,9 +97,6 @@ tests:
- equal: - equal:
path: spec.template.spec.dnsPolicy path: spec.template.spec.dnsPolicy
value: "ClusterFirst" value: "ClusterFirst"
- equal:
path: spec.template.spec.imagePullSecrets[0].name
value: "administration-image-pull-secret"
- equal: - equal:
path: spec.template.spec.restartPolicy path: spec.template.spec.restartPolicy
value: "Always" value: "Always"
......
...@@ -28,13 +28,13 @@ release: ...@@ -28,13 +28,13 @@ release:
templates: templates:
- templates/deployment.yaml - templates/deployment.yaml
set: set:
Release.Name: "administration"
ozgcloud: ozgcloud:
environment: "default" environment: "default"
bundesland: sh bundesland: sh
bezeichner: helm bezeichner: helm
sso: sso:
serverUrl: https://sso.company.local serverUrl: https://sso.company.local
imagePullSecret: image-pull-secret
tests: tests:
- it: should have volumeMounts on it's container - it: should have volumeMounts on it's container
asserts: asserts:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment