mirror of
https://github.com/YuzuZensai/netbird-kubernetes-operator.git
synced 2026-09-13 18:59:09 +00:00
Minor adjustment to the NBPolicy template to make ports and protocols
render as lists instead of strings.
Previously a values file like
```yaml
policies:
demo-policy:
name: "Demo Policy"
sourceGroups:
- demogroup
- demogroup2
ports:
- 443
- 80
protocols:
- tcp
- udp
```
would result in a rendered manifest like
```yaml
spec:
bidirectional: false
name: Demo Policy
ports:
- 80 443
protocols:
- tcp udp
sourceGroups:
- demogroup
- demogroup2
```
(.spec.ports[0]: expected numeric (int or float), got string)
32 lines
754 B
YAML
32 lines
754 B
YAML
{{- range $k, $v := $.Values.ingress.policies }}
|
|
---
|
|
apiVersion: netbird.io/v1
|
|
kind: NBPolicy
|
|
metadata:
|
|
finalizers:
|
|
- netbird.io/cleanup
|
|
labels:
|
|
app.kubernetes.io/component: operator
|
|
{{- include "kubernetes-operator.labels" $ | nindent 4 }}
|
|
annotations:
|
|
helm.sh/resource-policy: keep
|
|
name: {{ $k }}
|
|
spec:
|
|
name: {{ $v.name }}
|
|
sourceGroups:
|
|
{{ toYaml $v.sourceGroups | nindent 4}}
|
|
{{- if $v.description }}
|
|
description: {{ $v.description }}
|
|
{{- end }}
|
|
{{- if $v.protocols }}
|
|
protocols:
|
|
{{ toYaml $v.protocols | nindent 4}}
|
|
{{- end }}
|
|
{{- if $v.ports }}
|
|
ports:
|
|
{{ toYaml $v.ports | nindent 4}}
|
|
{{- end }}
|
|
{{- if hasKey $v "bidirectional" }}
|
|
bidirectional: {{ $v.bidirectional }}
|
|
{{- end }}
|
|
{{- end }} |