// NewDbBackupService Create a new service object for Database Backup

NewDbBackupService Create a new service object for Database Backup
// NewDbBackupService Create a new service object for Database Backup
func NewDbBackupService(bkp *v1alpha1.Backup, v *v1alpha1.MariaDB, scheme *runtime.Scheme) *corev1.Service {
	labels := utils.Labels(v, "mariadb-backup")
	selectorLabels := utils.Labels(v, "mariadb")
	s := &corev1.Service{
		ObjectMeta: metav1.ObjectMeta{
			Name:      mariadbBkpServiceName(bkp),
			Namespace: v.Namespace,
			Labels:    labels,
		},
		Spec: corev1.ServiceSpec{
			Selector: selectorLabels,
			Ports: []corev1.ServicePort{{
				Protocol:   corev1.ProtocolTCP,
				Port:       dbBakupServicePort,
				TargetPort: intstr.FromInt(dbBakupServiceTargetPort),
			}},
			Type: corev1.ServiceTypeClusterIP,
		},
	}
	controllerutil.SetControllerReference(v, s, scheme)
	return s
}
func NewDbBackupService ( bkp * v1alpha1 . Backup , v * v1alpha1 . MariaDB , scheme * runtime . Scheme ) * corev1 . Service { labels := utils . Labels ( v , " " ) selectorLabels := utils . Labels ( v , " " ) s := & corev1 . Service { ObjectMeta : metav1 . ObjectMeta { Name : mariadbBkpServiceName ( bkp ) , Namespace : v . Namespace , Labels : labels , } , Spec : corev1 . ServiceSpec { Selector : selectorLabels , Ports : [ ] corev1 . ServicePort { { Protocol : corev1 . ProtocolTCP , Port : dbBakupServicePort , TargetPort : intstr . FromInt ( dbBakupServiceTargetPort ) , } } , Type : corev1 . ServiceTypeClusterIP , } , } controllerutil . SetControllerReference ( v , s , scheme ) return s }
NewDbBackupService Create a new service object for Database Backup
NewDbBackupService Create a new service object for Database Backup