Skip to content

Commit

Permalink
Fix indent
Browse files Browse the repository at this point in the history
  • Loading branch information
bork91 committed Mar 18, 2024
1 parent 7f88943 commit 35f04c5
Showing 1 changed file with 43 additions and 24 deletions.
67 changes: 43 additions & 24 deletions openid/templates/netpol.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ spec:
- namespaceSelector:
matchLabels:
{{- end }}
{{- range $netpolKey, $netpolValue := $value.namespaceSelector}}
{{$netpolKey}}: {{$netpolValue}}
{{- end }}
{{- range $netpolKey, $netpolValue := $value.namespaceSelector}}
{{$netpolKey}}: {{$netpolValue}}
{{- end }}
{{- if ($value.podSelector) }}
podSelector:
matchLabels:
{{- end }}
{{- range $netpolKey, $netpolValue := $value.podSelector }}
{{$netpolKey}}: {{$netpolValue}}
{{- end }}
{{- range $netpolKey, $netpolValue := $value.podSelector }}
{{$netpolKey}}: {{$netpolValue}}
{{- end }}
{{- if ($value.ipBlock) }}
- ipBlock:
cidr: {{ $value.ipBlock }}
Expand All @@ -49,30 +49,49 @@ spec:
{{- range $key, $value := .Values.netpol.egress }}
# {{ $key }}
- to:
{{- if ($value.namespaceSelector) }}
- namespaceSelector:
matchLabels:
{{- end }}
{{- range $netpolKey, $netpolValue := $value.namespaceSelector }}
{{$netpolKey}}: {{$netpolValue}}
{{- end }}
{{- if ($value.podSelector) }}
podSelector:
matchLabels:
{{- end }}
{{- range $netpolKey, $netpolValue := $value.podSelector }}
{{$netpolKey}}: {{$netpolValue}}
{{- end }}
{{- if ($value.namespaceSelector) }}
- namespaceSelector:
matchLabels:
{{- end }}
{{- range $netpolKey, $netpolValue := $value.namespaceSelector }}
{{$netpolKey}}: {{$netpolValue}}
{{- end }}
{{- if ($value.podSelector) }}
podSelector:
matchLabels:
{{- end }}
{{- range $netpolKey, $netpolValue := $value.podSelector }}
{{$netpolKey}}: {{$netpolValue}}
{{- end }}
{{- if ($value.ipBlock) }}
- ipBlock:
cidr: {{ $value.ipBlock }}
{{- end }}
{{- if ($value.ports) }}
ports:
{{- end }}
{{- range $netpolKey, $netpolValue := $value.ports }}
- protocol: {{$netpolValue}}
port: {{$netpolKey}}
{{- end }}
{{- range $netpolKey, $netpolValue := $value.ports }}
- protocol: {{$netpolValue}}
port: {{$netpolKey}}
{{- end }}
{{- end }}
{{- end }}
---
{{- if .Values.netpol.allowLetsEncrypt }}
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: {{ include "service.fullname" . }}-lets-encrypt
namespace: {{ .Values.namespace | default "default" }}
spec:
podSelector:
matchLabels:
acme.cert-manager.io/http01-solver: 'true'
policyTypes:
- Ingress
ingress:
- from:
ports:
- port: 8089
protocol: TCP
{{- end }}

0 comments on commit 35f04c5

Please sign in to comment.