Skip to content

Commit 70953b1

Browse files
authored
Merge pull request docker#10591 from ndeloof/fix_detect_swarm_enabled
fix detection of swarm mode
2 parents 4dcda43 + cfe1a86 commit 70953b1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pkg/compose/compose.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,11 @@ func (s *composeService) isSWarmEnabled(ctx context.Context) (bool, error) {
277277
if err != nil {
278278
swarmEnabled.err = err
279279
}
280-
if info.Swarm.LocalNodeState == swarm.LocalNodeStateInactive {
281-
swarmEnabled.val = info.Swarm.LocalNodeState == swarm.LocalNodeStateInactive
280+
switch info.Swarm.LocalNodeState {
281+
case swarm.LocalNodeStateInactive, swarm.LocalNodeStateLocked:
282+
swarmEnabled.val = false
283+
default:
284+
swarmEnabled.val = true
282285
}
283286
})
284287
return swarmEnabled.val, swarmEnabled.err

0 commit comments

Comments
 (0)