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

Make an error for an invalid orchestrator #1055

Merged
merged 1 commit into from
May 14, 2018
Merged

Make an error for an invalid orchestrator #1055

merged 1 commit into from
May 14, 2018

Conversation

mat007
Copy link
Member

@mat007 mat007 commented May 11, 2018

- What I did

I made an invalid specified orchestrator yield an error instead of being silently ignored.

- How I did it

I added checks and error handling.

- How to verify it

Before if

$ cat ~/.docker/config.json | grep orchestrator
  "orchestrator": "kubernetes",

then (notice the missing r in swarm)

$ docker --orchestrator=swam stack ls
NAME                SERVICES            ORCHESTRATOR        NAMESPACE
dtcccccc            5                   Kubernetes          default

the orchestrator flag value being invalid it falls back to the one defined in ~/.docker/config.json.

Now it correctly fails with

$ docker --orchestrator=swam stack ls
specified orchestrator "swam" is invalid, please use either kubernetes or swarm

- Description for the changelog

An invalid orchestrator now generates an error instead of being silently ignored.

- A picture of a cute animal (not mandatory but encouraged)

image

Signed-off-by: Mathieu Champlon <mathieu.champlon@docker.com>
Copy link
Collaborator

@cpuguy83 cpuguy83 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

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

LGTM 🏑

@vdemeester vdemeester merged commit 161bc1e into docker:master May 14, 2018
@GordonTheTurtle GordonTheTurtle added this to the 18.06.0 milestone May 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants