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

OZG-3328 set imagePullSecret as required and cleanup

parent 344e09f8
Branches
Tags
No related merge requests found
Showing
with 26 additions and 53 deletions
......@@ -42,11 +42,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.envSpringProfiles" }}
{{- if (.Values.env).overrideSpringProfiles -}}
......
......@@ -156,11 +156,7 @@ spec:
dnsConfig: {}
dnsPolicy: ClusterFirst
imagePullSecrets:
{{- if .Values.imagePullSecret }}
- name: {{ .Values.imagePullSecret }}
{{ else }}
- name: {{ .Release.Name }}-image-pull-secret
{{- end }}
- name: {{ required "imagePullSecret must be set" .Values.imagePullSecret }}
restartPolicy: Always
{{- with .Values.hostAliases }}
hostAliases:
......
#
# Copyright (C) 2022 Das Land Schleswig-Holstein vertreten durch den
# Ministerpräsidenten des Landes Schleswig-Holstein
# Staatskanzlei
# Abteilung Digitalisierung und zentrales IT-Management der Landesregierung
#
# Lizenziert unter der EUPL, Version 1.2 oder - sobald
# diese von der Europäischen Kommission genehmigt wurden -
# Folgeversionen der EUPL ("Lizenz");
# Sie dürfen dieses Werk ausschließlich gemäß
# dieser Lizenz nutzen.
# Eine Kopie der Lizenz finden Sie hier:
#
# https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
#
# Sofern nicht durch anwendbare Rechtsvorschriften
# gefordert oder in schriftlicher Form vereinbart, wird
# die unter der Lizenz verbreitete Software "so wie sie
# ist", OHNE JEGLICHE GEWÄHRLEISTUNG ODER BEDINGUNGEN -
# ausdrücklich oder stillschweigend - verbreitet.
# Die sprachspezifischen Genehmigungen und Beschränkungen
# unter der Lizenz sind dem Lizenztext zu entnehmen.
#
{{- if not (.Values.imagePullSecret) }}
apiVersion: v1
kind: Secret
metadata:
name: {{ .Release.Name }}-image-pull-secret
namespace: {{ include "app.namespace" . }}
type: kubernetes.io/dockerconfigjson
data:
.dockerconfigjson: {{ include "app.imagePullSecret" . }}
{{- end }}
\ No newline at end of file
......@@ -28,4 +28,6 @@ ozgcloud:
bundesland: sh
networkPolicy:
dnsServerNamespace: test-dns-server-namespace
\ No newline at end of file
dnsServerNamespace: test-dns-server-namespace
imagePullSecret: image-pull-secret
\ No newline at end of file
......@@ -31,6 +31,7 @@ chart:
name: eingang-manager
set:
ozgcloud.environment: test
imagePullSecret: image-pull-secret
templates:
- templates/deployment.yaml
......
......@@ -27,6 +27,7 @@ templates:
- templates/deployment.yaml
set:
ozgcloud.environment: test
imagePullSecret: image-pull-secret
tests:
- it: should have temp-dir volume
asserts:
......
......@@ -30,6 +30,7 @@ templates:
- templates/deployment.yaml
set:
ozgcloud.environment: test
imagePullSecret: image-pull-secret
tests:
- it: check default values
asserts:
......
......@@ -30,8 +30,9 @@ templates:
- templates/deployment.yaml
set:
ozgcloud.environment: test
imagePullSecret: image-pull-secret
tests:
- it: should work
- it: should have correct health check values
asserts:
- equal:
path: spec.template.spec.containers[0].readinessProbe.failureThreshold
......
......@@ -31,6 +31,7 @@ templates:
set:
ozgcloud.environment: test
imagePullSecret: image-pull-secret
tests:
- it: check default labels
asserts:
......
......@@ -30,6 +30,7 @@ templates:
- templates/deployment.yaml
set:
ozgcloud.environment: test
imagePullSecret: image-pull-secret
tests:
- it: check for some standard values
asserts:
......
......@@ -30,6 +30,7 @@ templates:
- templates/deployment.yaml
set:
ozgcloud.environment: test
imagePullSecret: image-pull-secret
tests:
- it: check default values
asserts:
......
......@@ -27,6 +27,7 @@ templates:
- templates/deployment.yaml
set:
ozgcloud.environment: test
imagePullSecret: image-pull-secret
tests:
- it: check customList
set:
......
......@@ -31,6 +31,7 @@ templates:
set:
ozgcloud.environment: test
imagePullSecret: image-pull-secret
tests:
- it: should not set hostAliases
asserts:
......
......@@ -31,15 +31,14 @@ templates:
set:
ozgcloud.environment: test
tests:
- it: should use default imagePull secret
asserts:
- equal:
path: spec.template.spec.imagePullSecrets[0].name
value: afm-adapter-image-pull-secret
- it: should set the imagePull secret
set:
imagePullSecret: image-pull-secret
asserts:
- equal:
path: spec.template.spec.imagePullSecrets[0].name
value: image-pull-secret
\ No newline at end of file
value: image-pull-secret
- it: should fail tempalte when not set
asserts:
- failedTemplate:
errorMessage: imagePullSecret must be set
\ No newline at end of file
......@@ -27,6 +27,7 @@ templates:
- templates/deployment.yaml
set:
ozgcloud.environment: test
imagePullSecret: image-pull-secret
tests:
- it: livenessProbe should be disabled by default
asserts:
......
......@@ -30,6 +30,7 @@ templates:
- templates/deployment.yaml
set:
ozgcloud.environment: test
imagePullSecret: image-pull-secret
tests:
- it: should have correct pod template values
asserts:
......
......@@ -29,6 +29,7 @@ templates:
- templates/deployment.yaml
set:
ozgcloud.environment: test
imagePullSecret: image-pull-secret
tests:
- it: test resources
set:
......
......@@ -31,6 +31,7 @@ templates:
set:
image.tag: latest
ozgcloud.environment: test
imagePullSecret: image-pull-secret
tests:
- it: validate default routing values without questions.yaml
asserts:
......
......@@ -31,6 +31,7 @@ templates:
set:
ozgcloud.environment: test
imagePullSecret: image-pull-secret
tests:
- it: should use afm-adapter service account name
set:
......
......@@ -27,7 +27,8 @@ release:
name: if-adapter
templates:
- templates/deployment.yaml
set:
imagePullSecret: image-pull-secret
tests:
- it: should override spring profiles
set:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment