Skip to content

Commit

Permalink
fix(test): init werf docker failed on macOS
Browse files Browse the repository at this point in the history
Get platform from environment variables.

Signed-off-by: Alexey Igrychev <alexey.igrychev@flant.com>
  • Loading branch information
alexey-igrychev committed Jul 21, 2022
1 parent b6fcf63 commit 8306b57
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion test/pkg/utils/docker/container_command.go
Expand Up @@ -15,7 +15,15 @@ import (
)

func init() {
if err := docker.Init(context.Background(), "", true, true, ""); err != nil {
var platform string
for _, envName := range []string{"WERF_PLATFORM", "DOCKER_DEFAULT_PLATFORM"} {
platform = os.Getenv(envName)
if platform != "" {
break
}
}

if err := docker.Init(context.Background(), "", true, true, platform); err != nil {
_, _ = fmt.Fprintf(os.Stderr, "init werf docker failed: %s\n", err)
os.Exit(1)
}
Expand Down

0 comments on commit 8306b57

Please sign in to comment.