Skip to content

Commit e75929f

Browse files
committed
inttest/build: fix image-pull-proxy test
Previously, the test only worked if it was the first test that uses the baseImage. Otherwise, the image was already stored in the local container storage and no additional requests went through the proxy. Fix by using a clean container storage dir for this test. Signed-off-by: Adam Cmiel <acmiel@redhat.com>
1 parent be1ab96 commit e75929f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

integration_tests/build_test.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2464,6 +2464,11 @@ RUN cp /random-data.bin /data/realBaseImage.bin
24642464
contextDir := setupTestContext(t)
24652465
writeContainerfile(contextDir, fmt.Sprintf("FROM %s\n", baseImage))
24662466

2467+
// Use a clean container storage dir for this test to ensure the image gets pulled
2468+
containerStorage, err := createContainerStorageDir()
2469+
t.Cleanup(func() { removeContainerStorageDir(containerStorage) })
2470+
Expect(err).ToNot(HaveOccurred())
2471+
24672472
outputRef := "localhost/test-image-pull-proxy:" + GenerateUniqueTag(t)
24682473

24692474
buildParams := BuildParams{
@@ -2473,9 +2478,10 @@ RUN cp /random-data.bin /data/realBaseImage.bin
24732478
ImagePullProxy: "http://" + proxyAddr,
24742479
}
24752480

2476-
container := setupBuildContainerWithCleanup(t, buildParams, nil)
2481+
container := setupBuildContainerWithCleanup(t, buildParams, nil,
2482+
maybeMountContainerStorage(containerStorage, "taskuser"))
24772483

2478-
err := runBuild(container, buildParams)
2484+
err = runBuild(container, buildParams)
24792485
Expect(err).ToNot(HaveOccurred())
24802486

24812487
_, proxiedRegistry := connectedHosts.Load("registry.access.redhat.com:443")

0 commit comments

Comments
 (0)