diff --git a/calico/templates/bin/_calico-settings.sh.tpl b/calico/templates/bin/_calico-settings.sh.tpl index 4a058984b..a5821d073 100644 --- a/calico/templates/bin/_calico-settings.sh.tpl +++ b/calico/templates/bin/_calico-settings.sh.tpl @@ -75,10 +75,15 @@ EOF # Priority: {{ $n }} objects {{- range $section, $data := $envAll.Values.networking.policy }} {{- if eq (toString $data.priority) (toString $n) }} +{{/* add a safety check so we don't attempt to run calicoctl with an empty resource set */}} +{{- if gt (len $data.rules) 0 }} # Section: {{ $section }} Priority: {{ $data.priority }} {{ $n }} $CTL apply -f - <