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

return err when both two service modes in request #26643

Merged

Conversation

@allencloud
Copy link
Contributor

commented Sep 16, 2016

fixes #26642

- What I did
When validating service mode in dockerd, if both service modes replicated and global are set, return an error to tell user instead of creating a global mode service.

- How I did it

- How to verify it

- Description for the changelog

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

Signed-off-by: allencloud allen.sun@daocloud.io

@allencloud allencloud changed the title return err when both two service mode in request return err when both two service modes in request Sep 16, 2016

@vdemeester

This comment has been minimized.

Copy link
Member

commented Sep 16, 2016

//Mode
// Mode
if s.Mode.Global != nil && s.Mode.Replicated != nil {
return swarmapi.ServiceSpec{}, fmt.Errorf("Can not specify both replicated mode and global mode")

This comment has been minimized.

Copy link
@aaronlehmann

aaronlehmann Sep 16, 2016

Contributor

For consistency with other error messages:

cannot specify both replicated mode and global mode

This comment has been minimized.

Copy link
@allencloud

allencloud Sep 17, 2016

Author Contributor

Thanks @aaronlehmann . updated.

@allencloud allencloud force-pushed the allencloud:validate-two-service-modes-in-request branch from a169907 to 8848669 Sep 17, 2016

@aaronlehmann

This comment has been minimized.

Copy link
Contributor

commented Sep 17, 2016

LGTM

@stevvooe

This comment has been minimized.

Copy link
Contributor

commented Sep 17, 2016

LGTM

return err when both two service mode in request
Signed-off-by: allencloud <allen.sun@daocloud.io>

@allencloud allencloud force-pushed the allencloud:validate-two-service-modes-in-request branch from 8848669 to c413d41 Sep 17, 2016

@vdemeester vdemeester merged commit 1d8ad29 into moby:master Sep 17, 2016

7 checks passed

docker/dco-signed All commits signed
Details
documentation success
Details
experimental Jenkins build Docker-PRs-experimental 23845 has succeeded
Details
janky Jenkins build Docker-PRs 32432 has succeeded
Details
userns Jenkins build Docker-PRs-userns 14445 has succeeded
Details
win2lin Jenkins build Docker-PRs-Win2Lin 31172 has succeeded
Details
windowsRS1 Jenkins build Docker-PRs-WoW-RS1 3233 has succeeded
Details

@allencloud allencloud deleted the allencloud:validate-two-service-modes-in-request branch Sep 17, 2016

@thaJeztah thaJeztah added this to the 1.13.0 milestone Sep 17, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants
You can’t perform that action at this time.