Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix status exit code #2233

Merged
merged 2 commits into from
Jan 23, 2024
Merged

Fix status exit code #2233

merged 2 commits into from
Jan 23, 2024

Conversation

ttretau
Copy link
Contributor

@ttretau ttretau commented Jan 12, 2024

cilium status does currently return exit-code 0 in case of errors.

Adding an error here in case exists in the sub command, so it will result in correct exit-code 1.

Fixes #2232

Let the exit code be non-zero in case status check fails.

Signed-off-by: Torben Tretau <torben@tretau.net>
@ttretau ttretau requested a review from a team as a code owner January 12, 2024 13:22
@ttretau ttretau requested a review from derailed January 12, 2024 13:22
@maintainer-s-little-helper
Copy link

Commit a09d7b8 does not match "Signed-off-by".

Please follow instructions provided in https://docs.cilium.io/en/stable/contributing/development/contributing_guide/#developer-s-certificate-of-origin

Signed-off-by: Torben Tretau <torben@tretau.net>
Copy link
Contributor

@derailed derailed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ttretau Good catch. Thank you!

internal/cli/cmd/status.go Show resolved Hide resolved
@ttretau ttretau requested a review from derailed January 19, 2024 09:21
Copy link
Contributor

@derailed derailed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ttretau Thank you for looking into it!
Likely a separate pr to surface and format/print the actual error(s).

@tklauser tklauser merged commit d36c5fc into cilium:main Jan 23, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cilium status: exit-code wrong in case of errors
3 participants