Skip to content

Commit 00b6d7c

Browse files
committed
e2e: add option to create pods with different image in pod.Config
For testing certain features, the BusyBox image does not provide all the tools that are needed. Notably 'dd' from BusyBox does not support direct-io that is required for skipping caches while doing writes and reads on a Block-mode PVC attached to different nodes.
1 parent 3a7d710 commit 00b6d7c

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

test/e2e/framework/pod/create.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ type Config struct {
4848
SeLinuxLabel *v1.SELinuxOptions
4949
FsGroup *int64
5050
NodeSelection NodeSelection
51+
ImageID int
5152
}
5253

5354
// CreateUnschedulablePod with given claims based on node selector
@@ -185,6 +186,10 @@ func MakeSecPod(podConfig *Config) (*v1.Pod, error) {
185186
return &i
186187
}(1000)
187188
}
189+
image := imageutils.BusyBox
190+
if podConfig.ImageID != imageutils.None {
191+
image = podConfig.ImageID
192+
}
188193
podSpec := &v1.Pod{
189194
TypeMeta: metav1.TypeMeta{
190195
Kind: "Pod",
@@ -203,7 +208,7 @@ func MakeSecPod(podConfig *Config) (*v1.Pod, error) {
203208
Containers: []v1.Container{
204209
{
205210
Name: "write-pod",
206-
Image: imageutils.GetE2EImage(imageutils.BusyBox),
211+
Image: imageutils.GetE2EImage(image),
207212
Command: []string{"/bin/sh"},
208213
Args: []string{"-c", podConfig.Command},
209214
SecurityContext: &v1.SecurityContext{

test/utils/image/manifest.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,10 @@ var (
119119
)
120120

121121
const (
122+
// None is to be used for unset/default images
123+
None = iota
122124
// Agnhost image
123-
Agnhost = iota
125+
Agnhost
124126
// AgnhostPrivate image
125127
AgnhostPrivate
126128
// APIServer image

0 commit comments

Comments
 (0)