Skip to content

Commit 665c8ad

Browse files
committed
Fixing test
Signed-off-by: Jesse Brown <jabrown85@gmail.com>
1 parent 3c45ce5 commit 665c8ad

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

remote/remote_test.go

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"io"
66
"log"
77
"os"
8+
"os/exec"
89
"runtime"
910
"strings"
1011
"testing"
@@ -571,10 +572,14 @@ func testImage(t *testing.T, when spec.G, it spec.S) {
571572
h.AssertNil(t, image.Save())
572573
h.AssertEq(t, len(h.FetchManifestLayers(t, repoName)), 1)
573574

574-
// Pull the image via Docker to verify it works with containerd-snapshotter
575-
dockerClient := h.DockerCli(t)
576-
h.PullIfMissing(t, dockerClient, repoName)
577-
defer h.DockerRmi(dockerClient, repoName)
575+
// Pull the image via Docker CLI to verify it works with containerd-snapshotter.
576+
// Using exec.Command so it inherits DOCKER_CONFIG env var with registry credentials.
577+
cmd := exec.Command("docker", "pull", repoName)
578+
output, err := cmd.CombinedOutput()
579+
if err != nil {
580+
t.Fatalf("docker pull failed: %v\noutput: %s", err, string(output))
581+
}
582+
defer exec.Command("docker", "rmi", repoName).Run()
578583
})
579584
})
580585

0 commit comments

Comments
 (0)