diff --git a/elvia-deployment/templates/networkpolicy.yaml b/elvia-deployment/templates/networkpolicy.yaml index 16af701..eb37b45 100644 --- a/elvia-deployment/templates/networkpolicy.yaml +++ b/elvia-deployment/templates/networkpolicy.yaml @@ -22,7 +22,7 @@ spec: {{- if $value.application }} podSelector: matchLabels: - app.kubernetes.io/name: {{ $value.application }} + app: {{ $value.application }} {{- end }} {{- end }} {{- end }} @@ -66,7 +66,7 @@ spec: {{- if $value.application }} podSelector: matchLabels: - app.kubernetes.io/name: {{ $value.application }} + app: {{ $value.application }} {{- end }} {{- end }} {{- end }} diff --git a/elvia-deployment/tests/__snapshot__/networkpolicy_test.yaml.snap b/elvia-deployment/tests/__snapshot__/networkpolicy_test.yaml.snap index e1e0c8b..1a4466f 100644 --- a/elvia-deployment/tests/__snapshot__/networkpolicy_test.yaml.snap +++ b/elvia-deployment/tests/__snapshot__/networkpolicy_test.yaml.snap @@ -11,6 +11,9 @@ network policy snapshot should match: - namespaceSelector: matchLabels: kubernetes.io/metadata.name: core + podSelector: + matchLabels: + app: demo-app - to: - ipBlock: cidr: 0.0.0.0/0 @@ -46,7 +49,7 @@ network policy snapshot should match: kubernetes.io/metadata.name: core podSelector: matchLabels: - app.kubernetes.io/name: demo-app + app: demo-app - namespaceSelector: matchLabels: kubernetes.io/metadata.name: dns diff --git a/elvia-deployment/tests/networkpolicy_test.yaml b/elvia-deployment/tests/networkpolicy_test.yaml index 8ae8c27..2fa3d10 100644 --- a/elvia-deployment/tests/networkpolicy_test.yaml +++ b/elvia-deployment/tests/networkpolicy_test.yaml @@ -25,6 +25,7 @@ tests: outbound: rules: - namespace: "core" + application: "demo-app" ingress: subdomain: core path: "/demo-api"