testing: pull Docker images from mirror (#23190)

In https://github.com/hashicorp/nomad/pull/17401 we added test helpers that
would allow `docker` driver tests to pull from a mirror of the Docker Hub
registry. Extend the use of this helper a test that recently hit
rate-limiting.

Fixes: https://github.com/hashicorp/nomad/issues/23174
This commit is contained in:
Tim Gross
2024-06-06 11:21:45 -04:00
committed by GitHub
parent c3c2240304
commit 71fd5c2474

View File

@@ -24,6 +24,7 @@ import (
"github.com/hashicorp/nomad/helper/uuid"
"github.com/hashicorp/nomad/plugins/drivers"
dtestutil "github.com/hashicorp/nomad/plugins/drivers/testutils"
ntestutil "github.com/hashicorp/nomad/testutil"
tu "github.com/hashicorp/nomad/testutil"
"github.com/shoenig/test/must"
"github.com/stretchr/testify/assert"
@@ -667,7 +668,7 @@ func TestDockerDriver_Cleanup(t *testing.T) {
// using a small image and an specific point release to avoid accidental conflicts with other tasks
cfg := newTaskConfig("", []string{"sleep", "100"})
cfg.Image = "busybox:1.29.2"
cfg.Image = ntestutil.TestDockerImage("busybox", "1.29.2")
cfg.LoadImage = ""
task := &drivers.TaskConfig{
ID: uuid.Generate(),