Refactor the stack services
command to be uniform [carry 2131]
#2167
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
carries #2131
closes #2131
depends on:
build static binaries with -tags osusergo #2162 build static binaries with -tags osusergo- What I did
Running
docker stack services <STACK> --orchestrator swarm
would yield the message "Noting found in stack: asdf" with an exit code 0. The same command with kubernetes orchestrator would yield "nothing found in stack: adsf" (note the lower-case "nothing") and a non-zero exit code. This change makes thestack services
command uniform for both orchestrators. The logic of getting and printing services is split to reuse the same formatting code.- How to verify it
Run:
Both commands should return
0
and show the error messageNoting found in stack: unknown
.- Description for the changelog
Stack services will return the same exit code for all orchestrators.
- A picture of a cute animal (not mandatory but encouraged)
