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)