X Tutup
Skip to content

Make an error for an invalid orchestrator#1055

Merged
vdemeester merged 1 commit intodocker:masterfrom
mat007:fix-invalid-orchestrator-silently-ignored
May 14, 2018
Merged

Make an error for an invalid orchestrator#1055
vdemeester merged 1 commit intodocker:masterfrom
mat007:fix-invalid-orchestrator-silently-ignored

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

X Tutup