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

OZG-4846 update bayernid network policy

parent 2ed52020
No related branches found
No related tags found
No related merge requests found
...@@ -73,13 +73,18 @@ spec: ...@@ -73,13 +73,18 @@ spec:
ports: ports:
- port: 9000 - port: 9000
protocol: TCP protocol: TCP
{{- if ((.Values.ozgcloud).bayernid).enabled }}
- to: - to:
- podSelector: - podSelector:
matchLabels: matchLabels:
component: bayernid-proxy component: bayernid-proxy
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: {{ required "ozgcloud.bayernid.proxy.namespace must be set if bayernid is enabled" (((.Values.ozgcloud).bayernid).proxy).namespace }}
ports: ports:
- port: 9090 - port: 9090
protocol: TCP protocol: TCP
{{- end }}
- to: - to:
- namespaceSelector: - namespaceSelector:
matchLabels: matchLabels:
......
...@@ -177,10 +177,15 @@ tests: ...@@ -177,10 +177,15 @@ tests:
- port: 5353 - port: 5353
protocol: TCP protocol: TCP
- it: should add egress rule to nachrichten-bayernid-proxy - it: should add egress rule to nachrichten-bayernid-proxy if bayernid is enabled
set: set:
networkPolicy: networkPolicy:
dnsServerNamespace: test-dns-namespace dnsServerNamespace: test-dns-namespace
ozgcloud:
bayernid:
enabled: true
proxy:
namespace: bayernidProxyNamespace
asserts: asserts:
- contains: - contains:
path: spec.egress path: spec.egress
...@@ -188,11 +193,44 @@ tests: ...@@ -188,11 +193,44 @@ tests:
to: to:
- podSelector: - podSelector:
matchLabels: matchLabels:
component: nachrichten-bayernid-proxy component: bayernid-proxy
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: bayernidProxyNamespace
ports:
- port: 9090
protocol: TCP
- it: should not add egress rule to bayernid-proxy if bayernid is disabled
set:
networkPolicy:
dnsServerNamespace: test-dns-namespace
ozgcloud:
bayernid:
enabled: false
asserts:
- notContains:
path: spec.egress
content:
to:
- podSelector:
matchLabels:
component: bayernid-proxy
ports: ports:
- port: 9090 - port: 9090
protocol: TCP protocol: TCP
- it: should throw error if bayernid-proxy is enabled but bayernid namespace is not set
set:
networkPolicy:
dnsServerNamespace: test-dns-namespace
ozgcloud:
bayernid:
enabled: true
asserts:
- failedTemplate:
errorMessage: ozgcloud.bayernid.proxy.namespace must be set if bayernid is enabled
- it: add ingress rule by values - it: add ingress rule by values
set: set:
networkPolicy: networkPolicy:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment