Skip to content

Commit

Permalink
K8SPXC: set controller reference for PiTR deployment (#1880)
Browse files Browse the repository at this point in the history
Set controller reference for PiTR deployment the same way as it's set for PXC and proxy StatefulSets. This would crate a connection between PiTR deployment and cluster resource.
  • Loading branch information
s10 authored Jan 13, 2025
1 parent 191f386 commit 137e4f9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/controller/pxc/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}, &currentCollector)
Expand Down

0 comments on commit 137e4f9

Please sign in to comment.