mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
return err when both two service mode in request
Signed-off-by: allencloud <allen.sun@daocloud.io>
This commit is contained in:
parent
d93a62e9be
commit
c413d4177b
1 changed files with 5 additions and 1 deletions
|
@ -185,7 +185,11 @@ func ServiceSpecToGRPC(s types.ServiceSpec) (swarmapi.ServiceSpec, error) {
|
|||
}
|
||||
}
|
||||
|
||||
//Mode
|
||||
// Mode
|
||||
if s.Mode.Global != nil && s.Mode.Replicated != nil {
|
||||
return swarmapi.ServiceSpec{}, fmt.Errorf("cannot specify both replicated mode and global mode")
|
||||
}
|
||||
|
||||
if s.Mode.Global != nil {
|
||||
spec.Mode = &swarmapi.ServiceSpec_Global{
|
||||
Global: &swarmapi.GlobalService{},
|
||||
|
|
Loading…
Reference in a new issue