diff --git a/cmd/pitr/collector/collector.go b/cmd/pitr/collector/collector.go index 89bee47d15..36d3be474e 100644 --- a/cmd/pitr/collector/collector.go +++ b/cmd/pitr/collector/collector.go @@ -486,7 +486,7 @@ func (c *Collector) manageBinlog(ctx context.Context, binlog pxc.Binlog) (err er return errors.Wrapf(err, "put %s object", binlog.Name) } - log.Println("Successfully written binlog file", binlog.Name, "to s3 with name", binlogName) + log.Println("Successfully wrote binlog file", binlog.Name, "to storage with name", binlogName) err = cmd.Wait() if err != nil { @@ -502,7 +502,13 @@ func (c *Collector) manageBinlog(ctx context.Context, binlog pxc.Binlog) (err er // nolint:errcheck setBuffer.WriteString(binlog.GTIDSet.Raw()) - err = c.storage.PutObject(ctx, lastSetFilePrefix+strings.Split(gtidSet, ":")[0], &setBuffer, int64(setBuffer.Len())) + lastSetName := lastSetFilePrefix+strings.Split(gtidSet, ":")[0] + + // remove any newline characters from the last set name + lastSetName = strings.ReplaceAll(lastSetName, "\n", "") + lastSetName = strings.ReplaceAll(lastSetName, "\r", "") + + err = c.storage.PutObject(ctx, lastSetName, &setBuffer, int64(setBuffer.Len())) if err != nil { return errors.Wrap(err, "put last-set object") } diff --git a/pkg/controller/pxc/controller.go b/pkg/controller/pxc/controller.go index 4621463b5f..ef371a4173 100644 --- a/pkg/controller/pxc/controller.go +++ b/pkg/controller/pxc/controller.go @@ -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) } diff --git a/pkg/pxc/backup/storage/storage.go b/pkg/pxc/backup/storage/storage.go index 81c676d107..8768894450 100644 --- a/pkg/pxc/backup/storage/storage.go +++ b/pkg/pxc/backup/storage/storage.go @@ -235,7 +235,7 @@ func (a *Azure) PutObject(ctx context.Context, name string, data io.Reader, _ in } func (a *Azure) ListObjects(ctx context.Context, prefix string) ([]string, error) { - listPrefix := path.Join(a.prefix, prefix) + "/" + listPrefix := path.Join(a.prefix, prefix) pg := a.client.NewListBlobsFlatPager(a.container, &container.ListBlobsFlatOptions{ Prefix: &listPrefix, })