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

OZG-5100 add namespace additionamNetworkRules

parent 427c6223
No related branches found
No related tags found
No related merge requests found
...@@ -44,6 +44,9 @@ spec: ...@@ -44,6 +44,9 @@ spec:
component: vorgang-manager component: vorgang-manager
{{- with (.Values.networkPolicy).additionalIngressConfig }} {{- with (.Values.networkPolicy).additionalIngressConfig }}
{{ toYaml . | indent 2 }} {{ toYaml . | indent 2 }}
{{- end }}
{{- with (.Values.networkPolicy).additionalIngressConfigNamespace }}
{{ toYaml . | indent 2 }}
{{- end }} {{- end }}
egress: egress:
- to: - to:
...@@ -62,5 +65,8 @@ spec: ...@@ -62,5 +65,8 @@ spec:
{{- with (.Values.networkPolicy).additionalEgressConfig }} {{- with (.Values.networkPolicy).additionalEgressConfig }}
{{ toYaml . | indent 2 }} {{ toYaml . | indent 2 }}
{{- end }} {{- end }}
{{- with (.Values.networkPolicy).additionalEgressConfigNamespace }}
{{ toYaml . | indent 2 }}
{{- end }}
{{- end }} {{- end }}
\ No newline at end of file
...@@ -110,6 +110,7 @@ tests: ...@@ -110,6 +110,7 @@ tests:
matchLabels: matchLabels:
component: client2 component: client2
- it: add egress rules by values - it: add egress rules by values
set: set:
networkPolicy: networkPolicy:
...@@ -144,6 +145,44 @@ tests: ...@@ -144,6 +145,44 @@ tests:
- port: 12345 - port: 12345
protocol: TCP protocol: TCP
- it: should add additionalIngressConfigNamespace
set:
networkPolicy:
ssoPublicIp: 51.89.117.53/32
dnsServerNamespace: test-namespace-dns
additionalIngressConfigNamespace:
- from:
- podSelector:
matchLabels:
additionalIngressConfigNamespace: yes
asserts:
- contains:
path: spec.ingress
content:
from:
- podSelector:
matchLabels:
additionalIngressConfigNamespace: yes
- it: should add additionalEgressConfigNamespace
set:
networkPolicy:
dnsServerNamespace: test-dns-namespace
additionalEgressConfigNamespace:
- to:
- podSelector:
matchLabels:
additionalEgressConfigNamespace: yes
asserts:
- contains:
path: spec.egress
content:
to:
- podSelector:
matchLabels:
additionalEgressConfigNamespace: yes
- it: test network policy disabled - it: test network policy disabled
set: set:
networkPolicy: networkPolicy:
......
...@@ -47,6 +47,9 @@ spec: ...@@ -47,6 +47,9 @@ spec:
ozg-component: eingangsadapter ozg-component: eingangsadapter
{{- with (.Values.networkPolicy).additionalIngressConfig }} {{- with (.Values.networkPolicy).additionalIngressConfig }}
{{ toYaml . | indent 2 }} {{ toYaml . | indent 2 }}
{{- end }}
{{- with (.Values.networkPolicy).additionalIngressConfigNamespace }}
{{ toYaml . | indent 2 }}
{{- end }} {{- end }}
egress: egress:
- to: - to:
...@@ -101,5 +104,8 @@ spec: ...@@ -101,5 +104,8 @@ spec:
{{- with (.Values.networkPolicy).additionalEgressConfig }} {{- with (.Values.networkPolicy).additionalEgressConfig }}
{{ toYaml . | indent 2 }} {{ toYaml . | indent 2 }}
{{- end }} {{- end }}
{{- with (.Values.networkPolicy).additionalEgressConfigNamespace }}
{{ toYaml . | indent 2 }}
{{- end }}
{{- end }} {{- end }}
\ No newline at end of file
...@@ -287,6 +287,44 @@ tests: ...@@ -287,6 +287,44 @@ tests:
- port: 12345 - port: 12345
protocol: TCP protocol: TCP
- it: should add additionalIngressConfigNamespace
set:
networkPolicy:
ssoPublicIp: 51.89.117.53/32
dnsServerNamespace: test-namespace-dns
additionalIngressConfigNamespace:
- from:
- podSelector:
matchLabels:
additionalIngressConfigNamespace: yes
asserts:
- contains:
path: spec.ingress
content:
from:
- podSelector:
matchLabels:
additionalIngressConfigNamespace: yes
- it: should add additionalEgressConfigNamespace
set:
networkPolicy:
dnsServerNamespace: test-dns-namespace
additionalEgressConfigNamespace:
- to:
- podSelector:
matchLabels:
additionalEgressConfigNamespace: yes
asserts:
- contains:
path: spec.egress
content:
to:
- podSelector:
matchLabels:
additionalEgressConfigNamespace: yes
- it: test network policy disabled - it: test network policy disabled
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