Skip to content

Commit

Permalink
K8SPXC-1392 fix KubeAPIWarningLogger .metadata.ownerReferences contai…
Browse files Browse the repository at this point in the history
…ns duplicate entries (#1833)

* fix pmm version

* fix KubeAPIWarningLogger

---------

Co-authored-by: Viacheslav Sarzhan <[email protected]>
  • Loading branch information
nmarukovich and hors authored Oct 1, 2024
1 parent 4432542 commit 3313bd8
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions pkg/controller/pxc/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -503,19 +503,15 @@ func (r *ReconcilePerconaXtraDBCluster) reconcileHAProxy(ctx context.Context, cr

if cr.HAProxyReplicasServiceEnabled() {
svc := pxc.NewServiceHAProxyReplicas(cr)
err := setControllerReference(cr, svc, r.scheme)
if err != nil {
return errors.Wrapf(err, "%s setControllerReference", svc.Name)
}

if cr.CompareVersionWith("1.14.0") >= 0 {
e := cr.Spec.HAProxy.ExposeReplicas
err = r.createOrUpdateService(ctx, cr, svc, len(e.ServiceExpose.Labels) == 0 && len(e.ServiceExpose.Annotations) == 0)
err := r.createOrUpdateService(ctx, cr, svc, len(e.ServiceExpose.Labels) == 0 && len(e.ServiceExpose.Annotations) == 0)
if err != nil {
return errors.Wrapf(err, "%s upgrade error", svc.Name)
}
} else {
err = r.createOrUpdateService(ctx, cr, svc, len(podSpec.ReplicasServiceLabels) == 0 && len(podSpec.ReplicasServiceAnnotations) == 0)
err := r.createOrUpdateService(ctx, cr, svc, len(podSpec.ReplicasServiceLabels) == 0 && len(podSpec.ReplicasServiceAnnotations) == 0)
if err != nil {
return errors.Wrapf(err, "%s upgrade error", svc.Name)
}
Expand Down

0 comments on commit 3313bd8

Please sign in to comment.