From 8b45639641e9c924368de181d66687ebf4dec5e2 Mon Sep 17 00:00:00 2001 From: Vlad Gusev Date: Tue, 26 Nov 2024 14:24:36 +0200 Subject: [PATCH] K8SPXC: set controller referenece for PiTR deployment Set controller reference for PiTR deployment the same way as it's set for PXC and proxy StatefulSets --- pkg/controller/pxc/backup.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/controller/pxc/backup.go b/pkg/controller/pxc/backup.go index fa54c92a1..29af995c7 100644 --- a/pkg/controller/pxc/backup.go +++ b/pkg/controller/pxc/backup.go @@ -48,6 +48,10 @@ func (r *ReconcilePerconaXtraDBCluster) reconcileBackups(ctx context.Context, cr if err != nil { return errors.Errorf("get binlog collector deployment for cluster '%s': %v", cr.Name, err) } + err = setControllerReference(cr, &binlogCollector, r.scheme) + if err != nil { + return errors.Wrapf(err, "set controller reference for binlog collector deployment '%s'", binlogCollector.Name) + } currentCollector := appsv1.Deployment{} err = r.client.Get(context.TODO(), types.NamespacedName{Name: binlogCollector.Name, Namespace: binlogCollector.Namespace}, ¤tCollector)