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

Merge pull request 'OZG-5100 separate customList and additional networkpolicy...

Merge pull request 'OZG-5100 separate customList and additional networkpolicy config into local and global' (#115) from OZG-5100 into master

Reviewed-on: https://git.ozg-sh.de/ozgcloud-app/eingang-manager/pulls/115


Reviewed-by: default avatarOZGCloud <ozgcloud@mgm-tp.com>
parents 9a00826e 390aa911
No related branches found
No related tags found
No related merge requests found
......@@ -91,3 +91,10 @@ env:
- name: ...
value: ...
```
```yaml
env:
customList:
key_1: value_1
key_2: value_2
```
\ No newline at end of file
......@@ -88,4 +88,21 @@ app.kubernetes.io/namespace: {{ include "app.namespace" . }}
{{- else if eq (.Values.image).name "enterprise-adapter" }}
{{- printf "enterprise-adapter-service-account" }}
{{- end }}
{{- end -}}
{{- define "app.getCustomList" -}}
{{- with (.Values.env).customList -}}
{{- if kindIs "map" . -}}
{{ include "app.dictToList" . }}
{{- else if kindIs "slice" . -}}
{{ . | toYaml }}
{{- end -}}
{{- end -}}
{{- end -}}
{{- define "app.dictToList" -}}
{{- range $key, $value := . -}}
- name: {{ $key }}
value: {{ $value }}
{{- end -}}
{{- end -}}
\ No newline at end of file
......@@ -81,8 +81,8 @@ spec:
- name: grpc_client_vorgang-manager-{{ (.Values.routing).targetVorgangManagerName}}_negotiationType
value: {{ (.Values.routing).negotiationType | default "PLAINTEXT" }}
{{- end }}
{{- with (.Values.env).customList }}
{{ toYaml . | indent 8 }}
{{- with include "app.getCustomList" . }}
{{ . | indent 8 }}
{{- end }}
image: "{{ .Values.image.repo }}/{{ .Values.image.name }}:{{ coalesce (.Values.image).tag "latest" }}"
imagePullPolicy: Always
......
......@@ -29,18 +29,6 @@ image:
name: intelliform-adapter # [default: intelliform-adapter]
tag: latest # [default: latest]
# env:
# overrideSpringProfiles: "oc,prod"
# customList: # add name value pair for additional environments
# - name: Dinge
# value: true
#resources:
# limits:
# cpu: 1 # [default: 1]
# memory: 1200Mi # [default: 1200Mi]
# requests:
# cpu: 100m # [default: 100m]
# memory: 250Mi # [default: 250Mi]
ingress:
enabled: true
......
......@@ -29,7 +29,7 @@ set:
ozgcloud.environment: test
imagePullSecret: image-pull-secret
tests:
- it: check customList
- it: check customList as list
set:
env.customList:
- name: my_test_environment_name
......@@ -40,6 +40,16 @@ tests:
content:
name: my_test_environment_name
value: "A test value"
- it: check customList as dict
set:
env.customList:
my_test_environment_name: "A test value"
asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: my_test_environment_name
value: "A test value"
- it: check customList test value is not set by default
asserts:
- notContains:
......
......@@ -66,7 +66,10 @@ spec:
protocol: TCP
- port: 9000
protocol: TCP
{{- with (.Values.networkPolicy).additionalEgressConfig }}
{{- with (.Values.networkPolicy).additionalEgressConfigLocal }}
{{ toYaml . | indent 2 }}
{{- end }}
{{- with (.Values.networkPolicy).additionalEgressConfigGlobal }}
{{ toYaml . | indent 2 }}
{{- end }}
......
......@@ -89,12 +89,28 @@ tests:
- port: 9000
protocol: TCP
- it: add egress rules by values
- it: add egress rules by values local
set:
networkPolicy:
ssoPublicIp: 51.89.117.53/32
dnsServerNamespace: test-dns-namespace
additionalEgressConfig:
additionalEgressConfigLocal:
- to:
- ipBlock:
cidr: 1.2.3.4/32
asserts:
- contains:
path: spec.egress
content:
to:
- ipBlock:
cidr: 1.2.3.4/32
- it: add egress rules by values global
set:
networkPolicy:
ssoPublicIp: 51.89.117.53/32
dnsServerNamespace: test-dns-namespace
additionalEgressConfigGlobal:
- to:
- ipBlock:
cidr: 1.2.3.4/32
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment