func ApplyEtcdPersistentVolume(e *v1alpha1.EtcdCluster, app *tAppV1.TApp) {
	if e.Spec.Template.PersistentVolumeClaimSpec != nil {
		app.Spec.VolumeClaimTemplates = []corev1.PersistentVolumeClaim{
			{
				ObjectMeta: v1.ObjectMeta{
					Name: constants.EtcdDataVolumeName,
				},
				Spec: *e.Spec.Template.PersistentVolumeClaimSpec,
			},
		}
		for i := range app.Spec.TemplatePool {
			app.Spec.TemplatePool[i].Spec.Containers[0].VolumeMounts = append(app.Spec.TemplatePool[i].Spec.Containers[0].VolumeMounts,
				corev1.VolumeMount{
					Name:      constants.EtcdDataVolumeName,
					MountPath: constants.EtcdDataVolumeMountPath,
				})
		}
	}
}
// ApplyEtcdPersistentVolume set the TApp persistent volume option with EtcdCluster's persistent volume claim spec
ApplyEtcdPersistentVolume set the TApp persistent volume option with EtcdCluster's persistent volume claim spec
// ApplyEtcdPersistentVolume set the TApp persistent volume option with EtcdCluster ' s persistent volume claim spec
func ApplyEtcdPersistentVolume(e *v1alpha1.EtcdCluster, app *tAppV1.TApp) {
	if e.Spec.Template.PersistentVolumeClaimSpec != nil {
		app.Spec.VolumeClaimTemplates = []corev1.PersistentVolumeClaim{
			{
				ObjectMeta: v1.ObjectMeta{
					Name: constants.EtcdDataVolumeName,
				},
				Spec: *e.Spec.Template.PersistentVolumeClaimSpec,
			},
		}
		for i := range app.Spec.TemplatePool {
			app.Spec.TemplatePool[i].Spec.Containers[0].VolumeMounts = append(app.Spec.TemplatePool[i].Spec.Containers[0].VolumeMounts,
				corev1.VolumeMount{
					Name:      constants.EtcdDataVolumeName,
					MountPath: constants.EtcdDataVolumeMountPath,
				})
		}
	}
}
func ApplyEtcdPersistentVolume ( e * v1alpha1 . EtcdCluster , app * tAppV1 . TApp ) { if e . Spec . Template . PersistentVolumeClaimSpec != nil { app . Spec . VolumeClaimTemplates = [ ] corev1 . PersistentVolumeClaim { { ObjectMeta : v1 . ObjectMeta { Name : constants . EtcdDataVolumeName , } , Spec : * e . Spec . Template . PersistentVolumeClaimSpec , } , } for i := range app . Spec . TemplatePool { app . Spec . TemplatePool [ i ] . Spec . Containers [ 0 ] . VolumeMounts = append ( app . Spec . TemplatePool [ i ] . Spec . Containers [ 0 ] . VolumeMounts , corev1 . VolumeMount { Name : constants . EtcdDataVolumeName , MountPath : constants . EtcdDataVolumeMountPath , } ) } } }
ApplyEtcdPersistentVolume set the TApp persistent volume option with EtcdCluster's persistent volume claim spec
ApplyEtcdPersistentVolume set the TApp persistent volume option with EtcdCluster ' s persistent volume claim spec