fix detection of swarm mode

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
Nicolas De Loof 2023-05-22 08:26:22 +02:00
parent 4dcda432cf
commit cfe1a860ff
No known key found for this signature in database
GPG Key ID: 9858809D6F8F6E7E
1 changed files with 5 additions and 2 deletions

View File

@ -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