gitlab-ctl patroni switchover returns 0 even on failure
Summary
When issuing the command gitlab-ctl patroni switchover
, the result code is 0
(success), even when the output shows Switchover failed, details: 403, Access is denied
.
Steps to reproduce
- On a postgresql node, issue the command
gitlab-ctl patroni switchover
. - Notice that the result code is
0
(success), even when the switchover fails.
Example Project
GitLab 14.8.5-ee
What is the current bug behavior?
The command outputs a postgresql-formatted table listing the current cluster topology, followed by Switchover failed, details: 403, Access is denied
, but returns a result code of 0
(success).
What is the expected correct behavior?
The command should return a non-zero result code on failure.