fix(metallb): verify the metallb-system namespace actually exists

- change the Test metallb-system namespace task to run
  k3s kubectl get namespace metallb-system instead of the bare
  -n metallb-system, which printed kubectl usage and always exited 0
- add a regression test that asserts the task uses an explicit get
  and fails if it ever regresses to the usage-only form
- wire the new test into pre-commit
This commit is contained in:
Timothy Stewart
2026-08-06 09:08:11 -05:00
parent 287d8b7a27
commit e0ac53dba3
3 changed files with 81 additions and 1 deletions
+1 -1
View File
@@ -40,7 +40,7 @@
- name: Test metallb-system namespace
ansible.builtin.command: >-
{{ k3s_kubectl_binary | default('k3s kubectl') }} -n metallb-system
{{ k3s_kubectl_binary | default('k3s kubectl') }} get namespace metallb-system
changed_when: false
with_items: "{{ groups[group_name_master | default('master')] }}"
run_once: true