// If prepull is enabled, munge the container spec to make sure the images are not pulled
// during the test.
fori:=rangepod.Spec.Containers{
c:=&pod.Spec.Containers[i]
ifc.ImagePullPolicy==api.PullAlways{
// If the image pull policy is PullAlways, the image doesn't need to be in
// the white list or pre-pulled, because the image is expected to be pulled
// in the test anyway.
continue
}
// If the image policy is not PullAlways, the image must be in the white list and
// pre-pulled.
Expect(ImageWhiteList.Has(c.Image)).To(BeTrue(),"Image %q is not in the white list, consider adding it to CommonImageWhiteList in test/e2e/common/util.go or NodeImageWhiteList in test/e2e_node/image_list.go",c.Image)
// Do not pull images during the tests because the images in white list should have
@@ -92,6 +92,8 @@ type NodeTestContextType struct {
EvictionHardstring
// ManifestPath is the static pod manifest path.
ManifestPathstring
// PrepullImages indicates whether node e2e framework should prepull images.
PrepullImagesbool
}
typeCloudConfigstruct{
...
...
@@ -183,6 +185,7 @@ func RegisterNodeFlags() {
//flag.BoolVar(&TestContext.CgroupsPerQOS, "cgroups-per-qos", false, "Enable creation of QoS cgroup hierarchy, if true top level QoS and pod cgroups are created.")
flag.StringVar(&TestContext.EvictionHard,"eviction-hard","memory.available<250Mi,imagefs.available<10%","The hard eviction thresholds. If set, pods get evicted when the specified resources drop below the thresholds.")
flag.StringVar(&TestContext.ManifestPath,"manifest-path","","The path to the static pod manifest file.")
flag.BoolVar(&TestContext.PrepullImages,"prepull-images",true,"If true, prepull images so image pull failures do not cause test failures.")
}
// Enable viper configuration management of flags.