func makePodSpec(config e2evolume.TestConfig, initCmd string, volsrc v1.VolumeSource, podSecContext *v1.PodSecurityContext) *v1.Pod {
	var gracePeriod int64 = 1
	volName := fmt.Sprintf("io-volume-%s", config.Namespace)
	pod := &v1.Pod{
		TypeMeta: metav1.TypeMeta{
			Kind:       "Pod",
			APIVersion: "v1",
		},
		ObjectMeta: metav1.ObjectMeta{
			Name: config.Prefix + "-io-client",
			Labels: map[string]string{
				"role": config.Prefix + "-io-client",
			},
		},
		Spec: v1.PodSpec{
			InitContainers: []v1.Container{
				{
					Name:  config.Prefix + "-io-init",
					Image: framework.BusyBoxImage,
					Command: []string{
						"/bin/sh",
						"-c",
						initCmd,
					},
					VolumeMounts: []v1.VolumeMount{
						{
							Name:      volName,
							MountPath: mountPath,
						},
					},
				},
			},
			Containers: []v1.Container{
				{
					Name:  config.Prefix + "-io-client",
					Image: framework.BusyBoxImage,
					Command: []string{
						"/bin/sh",
						"-c",
						"sleep 3600", // keep pod alive until explicitly deleted
					},
					VolumeMounts: []v1.VolumeMount{
						{
							Name:      volName,
							MountPath: mountPath,
						},
					},
				},
			},
			TerminationGracePeriodSeconds: &gracePeriod,
			SecurityContext:               podSecContext,
			Volumes: []v1.Volume{
				{
					Name:         volName,
					VolumeSource: volsrc,
				},
			},
			RestartPolicy: v1.RestartPolicyNever, // want pod to fail if init container fails
		},
	}

	e2epod.SetNodeSelection(&pod.Spec, config.ClientNodeSelection)
	return pod
}
// Return the plugin's client pod spec. Use an InitContainer to setup the file i/o test env.
Return the plugin's client pod spec. Use an InitContainer to setup the file i/o test env.
// Return the plugin ' s client pod spec . Use an InitContainer to setup the file i / o test env .
func makePodSpec(config e2evolume.TestConfig, initCmd string, volsrc v1.VolumeSource, podSecContext *v1.PodSecurityContext) *v1.Pod {
	var gracePeriod int64 = 1
	volName := fmt.Sprintf("io-volume-%s", config.Namespace)
	pod := &v1.Pod{
		TypeMeta: metav1.TypeMeta{
			Kind:       "Pod",
			APIVersion: "v1",
		},
		ObjectMeta: metav1.ObjectMeta{
			Name: config.Prefix + "-io-client",
			Labels: map[string]string{
				"role": config.Prefix + "-io-client",
			},
		},
		Spec: v1.PodSpec{
			InitContainers: []v1.Container{
				{
					Name:  config.Prefix + "-io-init",
					Image: framework.BusyBoxImage,
					Command: []string{
						"/bin/sh",
						"-c",
						initCmd,
					},
					VolumeMounts: []v1.VolumeMount{
						{
							Name:      volName,
							MountPath: mountPath,
						},
					},
				},
			},
			Containers: []v1.Container{
				{
					Name:  config.Prefix + "-io-client",
					Image: framework.BusyBoxImage,
					Command: []string{
						"/bin/sh",
						"-c",
						"sleep 3600", 
					},
					VolumeMounts: []v1.VolumeMount{
						{
							Name:      volName,
							MountPath: mountPath,
						},
					},
				},
			},
			TerminationGracePeriodSeconds: &gracePeriod,
			SecurityContext:               podSecContext,
			Volumes: []v1.Volume{
				{
					Name:         volName,
					VolumeSource: volsrc,
				},
			},
			RestartPolicy: v1.RestartPolicyNever, 
		},
	}
	e2epod.SetNodeSelection(&pod.Spec, config.ClientNodeSelection)
	return pod
}
func makePodSpec ( config e2evolume . TestConfig , initCmd string , volsrc v1 . VolumeSource , podSecContext * v1 . PodSecurityContext ) * v1 . Pod { var gracePeriod int64 = 1 volName := fmt . Sprintf ( " " , config . Namespace ) pod := & v1 . Pod { TypeMeta : metav1 . TypeMeta { Kind : " " , APIVersion : " " , } , ObjectMeta : metav1 . ObjectMeta { Name : config . Prefix + " " , Labels : map [ string ] string { " " : config . Prefix + " " , } , } , Spec : v1 . PodSpec { InitContainers : [ ] v1 . Container { { Name : config . Prefix + " " , Image : framework . BusyBoxImage , Command : [ ] string { " " , " " , initCmd , } , VolumeMounts : [ ] v1 . VolumeMount { { Name : volName , MountPath : mountPath , } , } , } , } , Containers : [ ] v1 . Container { { Name : config . Prefix + " " , Image : framework . BusyBoxImage , Command : [ ] string { " " , " " , " " , } , VolumeMounts : [ ] v1 . VolumeMount { { Name : volName , MountPath : mountPath , } , } , } , } , TerminationGracePeriodSeconds : & gracePeriod , SecurityContext : podSecContext , Volumes : [ ] v1 . Volume { { Name : volName , VolumeSource : volsrc , } , } , RestartPolicy : v1 . RestartPolicyNever , } , } e2epod . SetNodeSelection ( & pod . Spec , config . ClientNodeSelection ) return pod }
Return the plugin's client pod spec.
Return the plugin ' s client pod spec .
// keep pod alive until explicitly deleted // want pod to fail if init container fails