Skip to content

Commit

Permalink
Respect cli argument
Browse files Browse the repository at this point in the history
  • Loading branch information
qwerty287 committed Jun 6, 2024
1 parent c724684 commit 256972a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pipeline/backend/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,11 @@ func (e *docker) Name() string {
return "docker"
}

func (e *docker) IsAvailable(context.Context) bool {
if os.Getenv("DOCKER_HOST") != "" {
return true
func (e *docker) IsAvailable(ctx context.Context) bool {
if c, ok := ctx.Value(backend.CliContext).(*cli.Context); ok {
if c.IsSet("backend-docker-host") {
return true
}

Check warning on line 69 in pipeline/backend/docker/docker.go

View check run for this annotation

Codecov / codecov/patch

pipeline/backend/docker/docker.go#L65-L69

Added lines #L65 - L69 were not covered by tests
}
_, err := os.Stat("/var/run/docker.sock")
return err == nil
Expand Down

0 comments on commit 256972a

Please sign in to comment.