func makeNginxPod(ns string, nodeSelector map[string]string, pvclaims []*v1.PersistentVolumeClaim) *v1.Pod {
	podSpec := &v1.Pod{
		TypeMeta: metav1.TypeMeta{
			Kind:       "Pod",
			APIVersion: "v1",
		},
		ObjectMeta: metav1.ObjectMeta{
			GenerateName: "pvc-tester-",
			Namespace:    ns,
		},
		Spec: v1.PodSpec{
			Containers: []v1.Container{
				{
					Name:  "write-pod",
					Image: "nginx",
					Ports: []v1.ContainerPort{
						{
							Name:          "http-server",
							ContainerPort: 80,
						},
					},
				},
			},
		},
	}
	var volumeMounts = make([]v1.VolumeMount, len(pvclaims))
	var volumes = make([]v1.Volume, len(pvclaims))
	for index, pvclaim := range pvclaims {
		volumename := fmt.Sprintf("volume%v", index+1)
		volumeMounts[index] = v1.VolumeMount{Name: volumename, MountPath: "/mnt/" + volumename}
		volumes[index] = v1.Volume{Name: volumename, VolumeSource: v1.VolumeSource{PersistentVolumeClaim: &v1.PersistentVolumeClaimVolumeSource{ClaimName: pvclaim.Name, ReadOnly: false}}}
	}
	podSpec.Spec.Containers[0].VolumeMounts = volumeMounts
	podSpec.Spec.Volumes = volumes
	if nodeSelector != nil {
		podSpec.Spec.NodeSelector = nodeSelector
	}
	return podSpec
}
// makeNginxPod returns a pod definition based on the namespace using nginx image
makeNginxPod returns a pod definition based on the namespace using nginx image
// makeNginxPod returns a pod definition based on the namespace using nginx image
func makeNginxPod(ns string, nodeSelector map[string]string, pvclaims []*v1.PersistentVolumeClaim) *v1.Pod {
	podSpec := &v1.Pod{
		TypeMeta: metav1.TypeMeta{
			Kind:       "Pod",
			APIVersion: "v1",
		},
		ObjectMeta: metav1.ObjectMeta{
			GenerateName: "pvc-tester-",
			Namespace:    ns,
		},
		Spec: v1.PodSpec{
			Containers: []v1.Container{
				{
					Name:  "write-pod",
					Image: "nginx",
					Ports: []v1.ContainerPort{
						{
							Name:          "http-server",
							ContainerPort: 80,
						},
					},
				},
			},
		},
	}
	var volumeMounts = make([]v1.VolumeMount, len(pvclaims))
	var volumes = make([]v1.Volume, len(pvclaims))
	for index, pvclaim := range pvclaims {
		volumename := fmt.Sprintf("volume%v", index+1)
		volumeMounts[index] = v1.VolumeMount{Name: volumename, MountPath: "/mnt/" + volumename}
		volumes[index] = v1.Volume{Name: volumename, VolumeSource: v1.VolumeSource{PersistentVolumeClaim: &v1.PersistentVolumeClaimVolumeSource{ClaimName: pvclaim.Name, ReadOnly: false}}}
	}
	podSpec.Spec.Containers[0].VolumeMounts = volumeMounts
	podSpec.Spec.Volumes = volumes
	if nodeSelector != nil {
		podSpec.Spec.NodeSelector = nodeSelector
	}
	return podSpec
}
func makeNginxPod ( ns string , nodeSelector map [ string ] string , pvclaims [ ] * v1 . PersistentVolumeClaim ) * v1 . Pod { podSpec := & v1 . Pod { TypeMeta : metav1 . TypeMeta { Kind : " " , APIVersion : " " , } , ObjectMeta : metav1 . ObjectMeta { GenerateName : " " , Namespace : ns , } , Spec : v1 . PodSpec { Containers : [ ] v1 . Container { { Name : " " , Image : " " , Ports : [ ] v1 . ContainerPort { { Name : " " , ContainerPort : 80 , } , } , } , } , } , } var volumeMounts = make ( [ ] v1 . VolumeMount , len ( pvclaims ) ) var volumes = make ( [ ] v1 . Volume , len ( pvclaims ) ) for index , pvclaim := range pvclaims { volumename := fmt . Sprintf ( " " , index + 1 ) volumeMounts [ index ] = v1 . VolumeMount { Name : volumename , MountPath : " " + volumename } volumes [ index ] = v1 . Volume { Name : volumename , VolumeSource : v1 . VolumeSource { PersistentVolumeClaim : & v1 . PersistentVolumeClaimVolumeSource { ClaimName : pvclaim . Name , ReadOnly : false } } } } podSpec . Spec . Containers [ 0 ] . VolumeMounts = volumeMounts podSpec . Spec . Volumes = volumes if nodeSelector != nil { podSpec . Spec . NodeSelector = nodeSelector } return podSpec }
makeNginxPod returns a pod definition based on the namespace using nginx image
makeNginxPod returns a pod definition based on the namespace using nginx image