@@ -299,17 +299,17 @@ func (r *NovaConductorReconciler) Reconcile(ctx context.Context, req ctrl.Reques
299299 return result , err
300300 }
301301
302- result , err = r .ensureCellDBSynced (ctx , h , instance , serviceAnnotations )
302+ result , err = r .ensureCellDBSynced (ctx , h , instance , serviceAnnotations , memcached )
303303 if (err != nil || result != ctrl.Result {}) {
304304 return result , err
305305 }
306306
307- result , err = r .ensureDeployment (ctx , h , instance , inputHash , serviceAnnotations )
307+ result , err = r .ensureDeployment (ctx , h , instance , inputHash , serviceAnnotations , memcached )
308308 if (err != nil || result != ctrl.Result {}) {
309309 return result , err
310310 }
311311
312- err = r .ensureDBPurgeCronJob (ctx , h , instance , serviceAnnotations )
312+ err = r .ensureDBPurgeCronJob (ctx , h , instance , serviceAnnotations , memcached )
313313 if err != nil {
314314 return ctrl.Result {}, err
315315 }
@@ -486,6 +486,14 @@ func (r *NovaConductorReconciler) generateConfigs(
486486 if instance .Spec .TLS .CaBundleSecretName != "" {
487487 tlsCfg = & tls.Service {}
488488 }
489+
490+ // MTLS
491+ if memcachedInstance .GetMemcachedMTLSSecret () != "" {
492+ templateParameters ["MemcachedAuthCert" ] = fmt .Sprint (memcachedv1 .CertMountPath ())
493+ templateParameters ["MemcachedAuthKey" ] = fmt .Sprint (memcachedv1 .KeyMountPath ())
494+ templateParameters ["MemcachedAuthCa" ] = fmt .Sprint (memcachedv1 .CaMountPath ())
495+ }
496+
489497 extraData := map [string ]string {
490498 "my.cnf" : cellDB .GetDatabaseClientConfig (tlsCfg ), //(mschuppert) for now just get the default my.cnf
491499 }
@@ -506,13 +514,15 @@ func (r *NovaConductorReconciler) ensureCellDBSynced(
506514 h * helper.Helper ,
507515 instance * novav1.NovaConductor ,
508516 annotations map [string ]string ,
517+ memcached * memcachedv1.Memcached ,
509518) (ctrl.Result , error ) {
510519 serviceLabels := map [string ]string {
511520 common .AppSelector : NovaConductorLabelPrefix ,
512521 }
513522 Log := r .GetLogger (ctx )
514523 dbSyncHash := instance .Status .Hash [DbSyncHash ]
515- jobDef := novaconductor .CellDBSyncJob (instance , serviceLabels , annotations )
524+
525+ jobDef := novaconductor .CellDBSyncJob (instance , serviceLabels , annotations , memcached )
516526 dbSyncJob := job .NewJob (jobDef , "dbsync" , instance .Spec .PreserveJobs , r .RequeueTimeout , dbSyncHash )
517527 ctrlResult , err := dbSyncJob .DoJob (ctx , h )
518528 if (ctrlResult != ctrl.Result {}) {
@@ -547,6 +557,7 @@ func (r *NovaConductorReconciler) ensureDeployment(
547557 instance * novav1.NovaConductor ,
548558 inputHash string ,
549559 annotations map [string ]string ,
560+ memcached * memcachedv1.Memcached ,
550561) (ctrl.Result , error ) {
551562 serviceLabels := map [string ]string {
552563 common .AppSelector : NovaConductorLabelPrefix ,
@@ -569,7 +580,7 @@ func (r *NovaConductorReconciler) ensureDeployment(
569580 return ctrl.Result {}, fmt .Errorf ("waiting for Topology requirements: %w" , err )
570581 }
571582
572- ss := statefulset .NewStatefulSet (novaconductor .StatefulSet (instance , inputHash , serviceLabels , annotations , topology ), r .RequeueTimeout )
583+ ss := statefulset .NewStatefulSet (novaconductor .StatefulSet (instance , inputHash , serviceLabels , annotations , topology , memcached ), r .RequeueTimeout )
573584 ctrlResult , err := ss .CreateOrPatch (ctx , h )
574585 if err != nil && ! k8s_errors .IsNotFound (err ) {
575586 Log .Error (err , "Deployment failed" )
@@ -642,11 +653,13 @@ func (r *NovaConductorReconciler) ensureDBPurgeCronJob(
642653 h * helper.Helper ,
643654 instance * novav1.NovaConductor ,
644655 annotations map [string ]string ,
656+ memcached * memcachedv1.Memcached ,
645657) error {
646658 serviceLabels := map [string ]string {
647659 common .AppSelector : NovaConductorLabelPrefix ,
648660 }
649- cronDef := novaconductor .DBPurgeCronJob (instance , serviceLabels , annotations )
661+
662+ cronDef := novaconductor .DBPurgeCronJob (instance , serviceLabels , annotations , memcached )
650663 cronjob := cronjob .NewCronJob (cronDef , r .RequeueTimeout )
651664
652665 _ , err := cronjob .CreateOrPatch (ctx , h )
0 commit comments