Merge pull request #26643 from allencloud/validate-two-service-modes-in-request
return err when both two service modes in request
This commit is contained in:
commit
1d8ad2974e
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…
Add table
Reference in a new issue