From 094b1bf01882c363023dc73c863846687f1e0244 Mon Sep 17 00:00:00 2001 From: carlory Date: Tue, 11 Nov 2025 10:31:12 +0800 Subject: [PATCH] fix [sig-node] Container Runtime blackbox test when running a container with a new image [Serial] should be able to pull from private registry with secret [NodeConformance] --- test/e2e/common/node/runtime.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/e2e/common/node/runtime.go b/test/e2e/common/node/runtime.go index 19c54050615..9cdec7df959 100644 --- a/test/e2e/common/node/runtime.go +++ b/test/e2e/common/node/runtime.go @@ -260,11 +260,13 @@ while true; do sleep 1; done framework.Context("when running a container with a new image", framework.WithSerial(), func() { var registryAddress string + var registryNodeNames []string ginkgo.BeforeEach(func(ctx context.Context) { var err error - registryAddress, _, err = e2eregistry.SetupRegistry(ctx, f, true) + registryAddress, registryNodeNames, err = e2eregistry.SetupRegistry(ctx, f, true) framework.ExpectNoError(err) + gomega.Expect(registryNodeNames).ToNot(gomega.BeEmpty()) // we need to wait for the registry to be removed and so we need to delete the whole NS ourselves ginkgo.DeferCleanup(func(ctx context.Context) { f.DeleteNamespace(ctx, f.Namespace.Name) @@ -282,6 +284,9 @@ while true; do sleep 1; done Image: image, ImagePullPolicy: v1.PullAlways, }, + // make sure the container is scheduled to the registry node when + // it is running node e2e tests or e2e tests. + NodeName: registryNodeNames[0], RestartPolicy: v1.RestartPolicyNever, } if hasSecret {