Skip to content

Commit cfe1a86

Browse files
committed
fix detection of swarm mode
Signed-off-by: Nicolas De Loof <[email protected]>
1 parent 4dcda43 commit cfe1a86

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)