Skip to content

Commit 49d22bf

Browse files
Refactor Hubble config conditions: use is not none instead of length > 0
Refactor: Replace `length > 0` with `is not none` for Hubble export config - Addressed reviewer feedback: avoid using `length > 0` which fails on integer types - Updated Jinja2 conditionals to use `is not none` for proper type safety - Prevents runtime errors when values are provided as integers (e.g., 100, 5)
1 parent 92278f2 commit 49d22bf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

roles/network_plugin/cilium/templates/cilium/config.yml.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,10 +222,10 @@ data:
222222
hubble-tls-client-ca-files: /var/lib/cilium/tls/hubble/client-ca.crt
223223
{% endif %}
224224

225-
{% if cilium_hubble_export_file_max_backups is defined and cilium_hubble_export_file_max_backups | length > 0 %}
225+
{% if cilium_hubble_export_file_max_backups is defined and cilium_hubble_export_file_max_backups is not none %}
226226
hubble-export-file-max-backups: "{{ cilium_hubble_export_file_max_backups }}"
227227
{% endif %}
228-
{% if cilium_hubble_export_file_max_size_mb is defined and cilium_hubble_export_file_max_size_mb | length > 0 %}
228+
{% if cilium_hubble_export_file_max_size_mb is defined and cilium_hubble_export_file_max_size_mb is not none %}
229229
hubble-export-file-max-size-mb: "{{ cilium_hubble_export_file_max_size_mb }}"
230230
{% endif %}
231231

0 commit comments

Comments
 (0)