Skip to content

Fix compose fallback for remote Docker hosts#809

Open
puneetdixit200 wants to merge 1 commit into
jesseduffield:masterfrom
puneetdixit200:fix/remote-compose-command
Open

Fix compose fallback for remote Docker hosts#809
puneetdixit200 wants to merge 1 commit into
jesseduffield:masterfrom
puneetdixit200:fix/remote-compose-command

Conversation

@puneetdixit200

Copy link
Copy Markdown

Summary

  • Keep the default docker compose command template when DOCKER_HOST is set.
  • Preserve the existing local fallback to docker-compose when no remote Docker host is configured and docker compose version fails.
  • Add a regression test for SSH/remote Docker hosts so project logs do not get rewritten to the missing legacy docker-compose binary.

Fixes #793

Test plan

  • GOFLAGS=-mod=vendor GOCACHE=/tmp/lazydocker-793-gocache go test ./pkg/commands -run TestSetDockerComposeCommandKeepsDefaultForRemoteDockerHost -count=1 failed before the fix with actual: "docker-compose"
  • GOFLAGS=-mod=vendor GOCACHE=/tmp/lazydocker-793-gocache go test ./pkg/commands -run 'Test(SetDockerComposeCommandKeepsDefaultForRemoteDockerHost|IsProjectScoped)' -count=1
  • GOFLAGS=-mod=vendor GOCACHE=/tmp/lazydocker-793-gocache go test ./...
  • GOFLAGS= GOCACHE=/tmp/lazydocker-793-gocache go run github.com/golangci/golangci-lint/cmd/golangci-lint@v1.64.8 run ./...
  • GOFLAGS=-mod=vendor GOCACHE=/tmp/lazydocker-793-gocache go vet ./...
  • GOFLAGS=-mod=vendor GOCACHE=/tmp/lazydocker-793-gocache go test -race ./pkg/commands -run 'Test(SetDockerComposeCommandKeepsDefaultForRemoteDockerHost|IsProjectScoped)' -count=1
  • git diff --check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Project Logs "docker-compose: command not found"

1 participant