func newProjectedVolume(cr *v1alpha1.RethinkDBCluster, name string) corev1.Volume {
	return corev1.Volume{
		Name: name,
		VolumeSource: corev1.VolumeSource{
			Projected: &corev1.ProjectedVolumeSource{
				Sources: []corev1.VolumeProjection{
					corev1.VolumeProjection{
						Secret: &corev1.SecretProjection{
							LocalObjectReference: corev1.LocalObjectReference{Name: fmt.Sprintf("%s-%s", cr.ObjectMeta.Name, RethinkDBCAKey)},
							Items: []corev1.KeyToPath{
								corev1.KeyToPath{
									Key:  corev1.TLSCertKey,
									Path: fmt.Sprintf("%s.crt", RethinkDBCAKey),
								},
							},
						},
					},
					newTLSVolumeProjection(cr, RethinkDBClusterKey),
					newTLSVolumeProjection(cr, RethinkDBDriverKey),
					newTLSVolumeProjection(cr, RethinkDBHttpKey),
				},
			},
		},
	}
}
newProjectedVolume creates a new Projected volume with the given name.
package rethinkdbcluster
import (
	"fmt"
	"github.com/jmckind/rethinkdb-operator/pkg/apis/rethinkdb/v1alpha1"
	corev1 "k8s.io/api/core/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
func isPVEnabled(cr *v1alpha1.RethinkDBCluster) bool {
	if podPolicy := cr.Spec.Pod; podPolicy != nil {
		return podPolicy.PersistentVolumeClaimSpec != nil
	}
	return false
}
func newEmptyDirVolume(name string) corev1.Volume {
	return corev1.Volume{
		Name: name,
		VolumeSource: corev1.VolumeSource{
			EmptyDir: &corev1.EmptyDirVolumeSource{},
		},
	}
}