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

OZG-5958 add customVars for xta-adapter

parent 2908a8b5
Branches
Tags
No related merge requests found
......@@ -58,4 +58,21 @@ helm.sh/chart: {{ include "app.chart" . }}
{{- define "app.serviceAccountName" -}}
{{ printf "%s" ( (.Values.serviceAccount).name | default "xta-adapter-service-account" ) }}
{{- 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
......@@ -34,6 +34,13 @@ spec:
ozg-component: xta-adapter
policyTypes:
- Egress
ingress:
{{- with (.Values.networkPolicy).additionalIngressConfigLocal }}
{{ toYaml . | indent 2 }}
{{- end }}
{{- with (.Values.networkPolicy).additionalIngressConfigGlobal }}
{{ toYaml . | indent 2 }}
{{- end }}
egress:
- to:
- podSelector:
......
......@@ -85,6 +85,9 @@ spec:
- name: grpc_client_vorgang-manager-{{ (.Values.routing).targetVorgangManagerName }}_negotiationType
value: {{ (.Values.routing).negotiationType | default "PLAINTEXT" }}
{{- end }}
{{- with include "app.getCustomList" . }}
{{ . | indent 16 }}
{{- end }}
volumeMounts:
- name: bindings
mountPath: "/bindings/ca-certificates/type"
......
......@@ -56,6 +56,7 @@ tests:
ozg-component: xta-adapter
policyTypes:
- Egress
ingress:
egress:
- to:
- podSelector:
......@@ -122,6 +123,40 @@ tests:
- ipBlock:
cidr: 1.2.3.4/32
- it: add ingress rule by values local
set:
networkPolicy:
dnsServerNamespace: test-namespace-dns
additionalIngressConfigLocal:
- from:
- podSelector:
matchLabels:
component: client2
asserts:
- contains:
path: spec.ingress
content:
from:
- podSelector:
matchLabels:
component: client2
- it: add ingress rule by values global
set:
networkPolicy:
dnsServerNamespace: test-namespace-dns
additionalIngressConfigGlobal:
- from:
- podSelector:
matchLabels:
component: client2
asserts:
- contains:
path: spec.ingress
content:
from:
- podSelector:
matchLabels:
component: client2
- it: test network policy disabled
set:
......
......@@ -154,4 +154,33 @@ tests:
path: spec.jobTemplate.spec.template.spec.containers[0].env
content:
name: grpc_client_vorgang-manager-vorgang-manager_negotiationType
value: "TLS"
\ No newline at end of file
value: "TLS"
- it: check customList as list
set:
env.customList:
- name: my_test_environment_name
value: "A test value"
asserts:
- contains:
path: spec.jobTemplate.spec.template.spec.containers[0].env
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.jobTemplate.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:
path: spec.jobTemplate.spec.template.spec.containers[0].env
content:
name: my_test_environment_name
value: "A test value"
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment