소스 검색

Merge pull request #10591 from ndeloof/fix_detect_swarm_enabled

fix detection of swarm mode
Guillaume Lours 2 년 전
부모
커밋
70953b18c0
1개의 변경된 파일5개의 추가작업 그리고 2개의 파일을 삭제
  1. 5 2
      pkg/compose/compose.go

+ 5 - 2
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