From cfe1a860ff6a1ef8fdab8c3b2d61bc011da66b88 Mon Sep 17 00:00:00 2001 From: Nicolas De Loof Date: Mon, 22 May 2023 08:26:22 +0200 Subject: [PATCH] fix detection of swarm mode Signed-off-by: Nicolas De Loof --- pkg/compose/compose.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/compose/compose.go b/pkg/compose/compose.go index 1fc6597a5..4d00fdbcf 100644 --- a/pkg/compose/compose.go +++ b/pkg/compose/compose.go @@ -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