Commit 3d2208b
committed
fix: avoid masking kubectl exit code in CatalogSource check
Separate local declaration from command substitution to preserve
kubectl's exit code. While the exit code isn't currently used in
this error path, following this best practice prevents potential
issues and improves code maintainability.
Before:
local state=$(kubectl get catalogsource ...)
After:
local state
state=$(kubectl get catalogsource ...)
This ensures $? reflects kubectl's exit status, not the local builtin.1 parent c1f31cc commit 3d2208b
1 file changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1154 | 1154 | | |
1155 | 1155 | | |
1156 | 1156 | | |
1157 | | - | |
| 1157 | + | |
| 1158 | + | |
1158 | 1159 | | |
1159 | 1160 | | |
1160 | 1161 | | |
| |||
0 commit comments