fix: kmeshctl authz enable/disable exit 0 despite failures and print false success message - #1895
bhumikadangayach wants to merge 1 commit into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Codecov Report✅ All modified and coverable lines are covered by tests. Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
…false success message Signed-off-by: Bhumika Dangayach <139267865+bhumikadangayach@users.noreply.github.com>
0df7bc7 to
1cb790d
Compare
Fixes #1894
kmeshctl authz disable <bad-pod>logged the failure but still exited with code 0 and printedAuthorization has been disabled.The root cause was that
SetAuthzPerKmeshDaemonlogged errors from request creation, the HTTP request, and non-200 responses without returning them. As a result,SetAuthzForPodscouldn't detect failures, and the enable/disable commands always printed a success message regardless of the outcome.This is the same underlying issue as #1871 and #1880 (and #1892 for the secret command).
Changes
SetAuthzPerKmeshDaemonreturn errors.SetAuthzForPodsand return an error if all requested pods fail.Verification
kmeshctl authz disable <nonexistent-pod>now exits with code 1 and no longer prints a false success message.