mirror of https://github.com/docker/compose.git
fix detection of swarm mode
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
4dcda432cf
commit
cfe1a860ff
|
@ -277,8 +277,11 @@ func (s *composeService) isSWarmEnabled(ctx context.Context) (bool, error) {
|
|||
if err != nil {
|
||||
swarmEnabled.err = err
|
||||
}
|
||||
if info.Swarm.LocalNodeState == swarm.LocalNodeStateInactive {
|
||||
swarmEnabled.val = info.Swarm.LocalNodeState == swarm.LocalNodeStateInactive
|
||||
switch info.Swarm.LocalNodeState {
|
||||
case swarm.LocalNodeStateInactive, swarm.LocalNodeStateLocked:
|
||||
swarmEnabled.val = false
|
||||
default:
|
||||
swarmEnabled.val = true
|
||||
}
|
||||
})
|
||||
return swarmEnabled.val, swarmEnabled.err
|
||||
|
|
Loading…
Reference in New Issue