mirror of
https://github.com/cuigh/swirl
synced 2025-01-30 22:37:21 +00:00
Fix service mode updating
Unfortunately mode still can’t be modified on current Docker engine API(1.32)
This commit is contained in:
parent
dfb06445a1
commit
b0c0d3a0d9
@ -151,11 +151,13 @@ func ServiceUpdate(info *model.ServiceInfo) error {
|
||||
// Mode
|
||||
if info.Mode == "replicated" {
|
||||
if spec.Mode.Replicated == nil {
|
||||
spec.Mode.Global = nil
|
||||
spec.Mode.Replicated = &swarm.ReplicatedService{Replicas: &info.Replicas}
|
||||
} else {
|
||||
spec.Mode.Replicated.Replicas = &info.Replicas
|
||||
}
|
||||
} else if info.Mode == "global" && spec.Mode.Global == nil {
|
||||
spec.Mode.Replicated = nil
|
||||
spec.Mode.Global = &swarm.GlobalService{}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user