Commit 0db759d
fix: add retry logic to kubectl-ko getOvnCentralPod for leader election
getOvnCentralPod() would crash silently during OVN leader election
transitions. Under `set -euo pipefail`, when no pod had the leader
label (e.g. ovn-nb-leader=true), `grep ovn-central` in the pipeline
returned exit code 1, causing the script to exit immediately without
any error message. This made kubectl-ko trace and other subcommands
fail intermittently in e2e tests.
Extract a getLeaderPod() helper that retries up to 10 times with 1s
intervals, protecting the pipeline with `set +o pipefail` and
suppressing kubectl stderr noise. Also fix NORTHD_POD query to use
$KUBE_OVN_NS instead of hardcoded kube-system.
Signed-off-by: Mengxin Liu <liumengxinfly@gmail.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 53b0946 commit 0db759d
1 file changed
+22
-19
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
811 | 811 | | |
812 | 812 | | |
813 | 813 | | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
814 | 832 | | |
815 | | - | |
816 | | - | |
817 | | - | |
818 | | - | |
819 | | - | |
820 | | - | |
821 | | - | |
822 | | - | |
823 | | - | |
824 | | - | |
825 | | - | |
826 | | - | |
827 | | - | |
828 | | - | |
829 | | - | |
830 | | - | |
831 | | - | |
832 | | - | |
833 | | - | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
834 | 837 | | |
835 | 838 | | |
836 | 839 | | |
| |||
0 commit comments