// +build !windows

package containerd

import (
	"runtime"
)

const (
	defaultRoot    = "/var/lib/containerd-test"
	defaultAddress = "/run/containerd-test/containerd.sock"
)

var (
	testImage string
)

func platformTestSetup(client *Client) error {
	return nil
}

func init() {
	switch runtime.GOARCH {
	case "386":
		testImage = "docker.io/i386/alpine:latest"
	case "arm":
		testImage = "docker.io/arm32v6/alpine:latest"
	case "arm64":
		testImage = "docker.io/arm64v8/alpine:latest"
	case "ppc64le":
		testImage = "docker.io/ppc64le/alpine:latest"
	case "s390x":
		testImage = "docker.io/s390x/alpine:latest"
	default:
		testImage = "docker.io/library/alpine:latest"
	}
}

// +build !windows

package containerd

const (
	defaultRoot    = "/var/lib/containerd-test"
	defaultAddress = "/run/containerd-test/containerd.sock"
	testImage      = "docker.io/library/alpine:latest"
)

func platformTestSetup(client *Client) error {
	return nil
}

--- 
+++ 
@@ -2,12 +2,36 @@
 
 package containerd
 
+import (
+	"runtime"
+)
+
 const (
 	defaultRoot    = "/var/lib/containerd-test"
 	defaultAddress = "/run/containerd-test/containerd.sock"
-	testImage      = "docker.io/library/alpine:latest"
+)
+
+var (
+	testImage string
 )
 
 func platformTestSetup(client *Client) error {
 	return nil
 }
+
+func init() {
+	switch runtime.GOARCH {
+	case "386":
+		testImage = "docker.io/i386/alpine:latest"
+	case "arm":
+		testImage = "docker.io/arm32v6/alpine:latest"
+	case "arm64":
+		testImage = "docker.io/arm64v8/alpine:latest"
+	case "ppc64le":
+		testImage = "docker.io/ppc64le/alpine:latest"
+	case "s390x":
+		testImage = "docker.io/s390x/alpine:latest"
+	default:
+		testImage = "docker.io/library/alpine:latest"
+	}
+}
Change test image based on platform

This changes testImage so it can be run on other platforms.

Signed-off-by: Christopher Jones <da8482a61c3a314f69bc15b69175fd62d9234b97@linux.vnet.ibm.com>
