You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
microk8s status returns 0 when the server is down.
$ microk8s status --yaml ; echo $? microk8s is not running, try microk8s start
0
What Should Happen Instead?
I would expect it to return non-zero, so that I don't need to search for text in the output.
This also complicates my life when trying to directly parse its output as yaml.
Reproduction Steps
It happens always, both and without --yaml. Retval is always zero.
Introspection Report
Probably not relevant.
Can you suggest a fix?
Yes, simply return non-zero when the server is down.
Fix scripts/wrappers/common/utils.py:
def exit_if_stopped():
stoppedLockFile = os.path.expandvars("${SNAP_DATA}/var/lock/stopped.lock")
if os.path.isfile(stoppedLockFile):
print("microk8s is not running, try microk8s start")
**exit(0)**
Are you interested in contributing with a fix?
Yes, it's about changing that zero by a one.
I can make a PR if you wish.
The text was updated successfully, but these errors were encountered:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Summary
microk8s status returns 0 when the server is down.
$ microk8s status --yaml ; echo $?
microk8s is not running, try microk8s start
0
What Should Happen Instead?
I would expect it to return non-zero, so that I don't need to search for text in the output.
This also complicates my life when trying to directly parse its output as yaml.
Reproduction Steps
Introspection Report
Probably not relevant.
Can you suggest a fix?
Yes, simply return non-zero when the server is down.
Fix scripts/wrappers/common/utils.py:
Are you interested in contributing with a fix?
Yes, it's about changing that zero by a one.
I can make a PR if you wish.
The text was updated successfully, but these errors were encountered: