From e576e0045625566f1d95cfa7e197dccd6d927ecd Mon Sep 17 00:00:00 2001 From: Erik Brakkee Date: Fri, 3 Jan 2025 00:31:03 +0100 Subject: [PATCH] more fixes for the netpolicy schema. --- cmd/policygen/templates/netpol/pod/pod.yaml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/cmd/policygen/templates/netpol/pod/pod.yaml b/cmd/policygen/templates/netpol/pod/pod.yaml index 0a89051..b507142 100644 --- a/cmd/policygen/templates/netpol/pod/pod.yaml +++ b/cmd/policygen/templates/netpol/pod/pod.yaml @@ -15,11 +15,11 @@ namespaceSelector: matchLabels: kubernetes.io/metadata.name: {{ .Application.Namespace.Name }} - {{- if .Ports }} - ports: - {{- template "ports" .Ports }} - {{- end }} - {{- end }} + {{- if .Ports }} + ports: + {{- template "ports" .Ports }} + {{- end }} +{{- end }} {{- end }} {{- define "networks" }} {{- range .Networks }} @@ -31,11 +31,11 @@ {{- range $except := .Network.Except }} - {{ $except }} {{- end }} - {{- if .Ports }} - ports: - {{- template "ports" .Ports }} - {{- end }} - {{- end }} + {{- if .Ports }} + ports: + {{- template "ports" .Ports }} + {{- end }} +{{- end }} {{- end }} {{- if not .app.Namespace.Open }}