Skip to content

Commit d07095d

Browse files
authored
Merge pull request kubernetes#92711 from alejandrox1/rename-image-prepull-lists
Renamed image "white lists" to pre-pull image lists in test
2 parents f023f58 + 4338053 commit d07095d

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

test/e2e/common/util.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ var CurrentSuite Suite
6060
// PrePulledImages are a list of images used in e2e/common tests. These images should be prepulled
6161
// before tests starts, so that the tests won't fail due image pulling flakes.
6262
// Currently, this is only used by node e2e test.
63-
// See also updateImageWhiteList() in ../../e2e_node/image_list.go
63+
// See also updateImageAllowList() in ../../e2e_node/image_list.go
6464
// TODO(random-liu): Change the image puller pod to use similar mechanism.
6565
var PrePulledImages = sets.NewString(
6666
imageutils.GetE2EImage(imageutils.Agnhost),

test/e2e/framework/pods.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ const (
5757
forbiddenReason = "SysctlForbidden"
5858
)
5959

60-
// ImageWhiteList is the images used in the current test suite. It should be initialized in test suite and
61-
// the images in the white list should be pre-pulled in the test suite. Currently, this is only used by
60+
// ImagePrePullList is the images used in the current test suite. It should be initialized in test suite and
61+
// the images in the list should be pre-pulled in the test suite. Currently, this is only used by
6262
// node e2e test.
63-
var ImageWhiteList sets.String
63+
var ImagePrePullList sets.String
6464

6565
// PodClient is a convenience method for getting a pod client interface in the framework's namespace,
6666
// possibly applying test-suite specific transformations to the pod spec, e.g. for
@@ -187,7 +187,7 @@ func (c *PodClient) mungeSpec(pod *v1.Pod) {
187187
}
188188
// If the image policy is not PullAlways, the image must be in the pre-pull list and
189189
// pre-pulled.
190-
gomega.Expect(ImageWhiteList.Has(c.Image)).To(gomega.BeTrue(), "Image %q is not in the white list, consider adding it to CommonImageWhiteList in test/e2e/common/util.go or NodePrePullImageList in test/e2e_node/image_list.go", c.Image)
190+
gomega.Expect(ImagePrePullList.Has(c.Image)).To(gomega.BeTrue(), "Image %q is not in the pre-pull list, consider adding it to PrePulledImages in test/e2e/common/util.go or NodePrePullImageList in test/e2e_node/image_list.go", c.Image)
191191
// Do not pull images during the tests because the images in pre-pull list should have
192192
// been prepulled.
193193
c.ImagePullPolicy = v1.PullNever

test/e2e_node/e2e_node_suite_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ var _ = ginkgo.SynchronizedBeforeSuite(func() []byte {
179179
// This helps with debugging test flakes since it is hard to tell when a test failure is due to image pulling.
180180
if framework.TestContext.PrepullImages {
181181
klog.Infof("Pre-pulling images so that they are cached for the tests.")
182-
updateImageWhiteList()
182+
updateImageAllowList()
183183
err := PrePullAllImages()
184184
gomega.Expect(err).ShouldNot(gomega.HaveOccurred())
185185
}
@@ -279,7 +279,7 @@ func waitForNodeReady() {
279279
// update test context with node configuration.
280280
func updateTestContext() error {
281281
setExtraEnvs()
282-
updateImageWhiteList()
282+
updateImageAllowList()
283283

284284
client, err := getAPIServerClient()
285285
if err != nil {

test/e2e_node/image_list.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,16 @@ var NodePrePullImageList = sets.NewString(
6161
"gcr.io/kubernetes-e2e-test-images/node-perf/tf-wide-deep-amd64:1.0",
6262
)
6363

64-
// updateImageWhiteList updates the framework.ImageWhiteList with
64+
// updateImageAllowList updates the framework.ImagePrePullList with
6565
// 1. the hard coded lists
6666
// 2. the ones passed in from framework.TestContext.ExtraEnvs
6767
// So this function needs to be called after the extra envs are applied.
68-
func updateImageWhiteList() {
69-
// Union NodePrePullImageList and CommonImageWhiteList into the framework image pre-pull list.
70-
framework.ImageWhiteList = NodePrePullImageList.Union(commontest.PrePulledImages)
68+
func updateImageAllowList() {
69+
// Union NodePrePullImageList and PrePulledImages into the framework image pre-pull list.
70+
framework.ImagePrePullList = NodePrePullImageList.Union(commontest.PrePulledImages)
7171
// Images from extra envs
72-
framework.ImageWhiteList.Insert(getNodeProblemDetectorImage())
73-
framework.ImageWhiteList.Insert(getSRIOVDevicePluginImage())
72+
framework.ImagePrePullList.Insert(getNodeProblemDetectorImage())
73+
framework.ImagePrePullList.Insert(getSRIOVDevicePluginImage())
7474
}
7575

7676
func getNodeProblemDetectorImage() string {
@@ -149,7 +149,7 @@ func PrePullAllImages() error {
149149
if err != nil {
150150
return err
151151
}
152-
images := framework.ImageWhiteList.List()
152+
images := framework.ImagePrePullList.List()
153153
klog.V(4).Infof("Pre-pulling images with %s %+v", puller.Name(), images)
154154
for _, image := range images {
155155
var (

0 commit comments

Comments
 (0)