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 }}