func diskConcealingPod(name string, diskConsumedMB int, volumeSource *v1.VolumeSource, resources v1.ResourceRequirements) *v1.Pod {
	path := ""
	volumeMounts := []v1.VolumeMount{}
	volumes := []v1.Volume{}
	if volumeSource != nil {
		path = volumeMountPath
		volumeMounts = []v1.VolumeMount{{MountPath: volumeMountPath, Name: volumeName}}
		volumes = []v1.Volume{{Name: volumeName, VolumeSource: *volumeSource}}
	}
	return &v1.Pod{
		ObjectMeta: metav1.ObjectMeta{Name: fmt.Sprintf("%s-pod", name)},
		Spec: v1.PodSpec{
			RestartPolicy: v1.RestartPolicyNever,
			Containers: []v1.Container{
				{
					Image: imageutils.GetE2EImage(imageutils.Perl),
					Name:  fmt.Sprintf("%s-container", name),
					Command: []string{
						"perl",
						"-e",
						fmt.Sprintf(writeConcealedPodCommand, filepath.Join(path, "file"), diskConsumedMB),
					},
					Resources:    resources,
					VolumeMounts: volumeMounts,
				},
			},
			Volumes: volumes,
		},
	}
}
// This is needed for testing eviction of pods using disk space in concealed files; the shell has no convenient
// way of performing I/O to a concealed file, and the busybox image doesn't contain Perl.
This is needed for testing eviction of pods using disk space in concealed files; the shell has no convenient
way of performing I/O to a concealed file, and the busybox image doesn't contain Perl.
// This is needed for testing eviction of pods using disk space in concealed files ; the shell has no convenient // way of performing I / O to a concealed file and the busybox image doesn ' t contain Perl .
func diskConcealingPod(name string, diskConsumedMB int, volumeSource *v1.VolumeSource, resources v1.ResourceRequirements) *v1.Pod {
	path := ""
	volumeMounts := []v1.VolumeMount{}
	volumes := []v1.Volume{}
	if volumeSource != nil {
		path = volumeMountPath
		volumeMounts = []v1.VolumeMount{{MountPath: volumeMountPath, Name: volumeName}}
		volumes = []v1.Volume{{Name: volumeName, VolumeSource: *volumeSource}}
	}
	return &v1.Pod{
		ObjectMeta: metav1.ObjectMeta{Name: fmt.Sprintf("%s-pod", name)},
		Spec: v1.PodSpec{
			RestartPolicy: v1.RestartPolicyNever,
			Containers: []v1.Container{
				{
					Image: imageutils.GetE2EImage(imageutils.Perl),
					Name:  fmt.Sprintf("%s-container", name),
					Command: []string{
						"perl",
						"-e",
						fmt.Sprintf(writeConcealedPodCommand, filepath.Join(path, "file"), diskConsumedMB),
					},
					Resources:    resources,
					VolumeMounts: volumeMounts,
				},
			},
			Volumes: volumes,
		},
	}
}
func diskConcealingPod ( name string , diskConsumedMB int , volumeSource * v1 . VolumeSource , resources v1 . ResourceRequirements ) * v1 . Pod { path := " " volumeMounts := [ ] v1 . VolumeMount { } volumes := [ ] v1 . Volume { } if volumeSource != nil { path = volumeMountPath volumeMounts = [ ] v1 . VolumeMount { { MountPath : volumeMountPath , Name : volumeName } } volumes = [ ] v1 . Volume { { Name : volumeName , VolumeSource : * volumeSource } } } return & v1 . Pod { ObjectMeta : metav1 . ObjectMeta { Name : fmt . Sprintf ( " " , name ) } , Spec : v1 . PodSpec { RestartPolicy : v1 . RestartPolicyNever , Containers : [ ] v1 . Container { { Image : imageutils . GetE2EImage ( imageutils . Perl ) , Name : fmt . Sprintf ( " " , name ) , Command : [ ] string { " " , " " , fmt . Sprintf ( writeConcealedPodCommand , filepath . Join ( path , " " ) , diskConsumedMB ) , } , Resources : resources , VolumeMounts : volumeMounts , } , } , Volumes : volumes , } , } }
This is needed for testing eviction of pods using disk space in concealed files; the shell has no convenient
way of performing I/O to a concealed file, and the busybox image doesn't contain Perl.
This is needed for testing eviction of pods using disk space in concealed files ; the shell has no convenient way of performing I / O to a concealed file and the busybox image doesn ' t contain Perl .