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