Merge pull request #10591 from ndeloof/fix_detect_swarm_enabled

fix detection of swarm mode
This commit is contained in:
Guillaume Lours 2023-05-22 09:25:56 +02:00 committed by GitHub
commit 70953b18c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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