Skip to content
Permalink
Browse files
fix(test): init werf docker failed on macOS
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 8306b572edadb4f8583c5d098457c21ba1e07c35
Showing 1 changed file with 9 additions and 1 deletion.
@@ -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)
}

0 comments on commit 8306b57

Please sign in to comment.