Skip to content

Commit

Permalink
Remove source- prefix from BackupEntry when performing deletion (#726)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kostov6 authored Mar 13, 2024
1 parent a65713d commit e1b642f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/controller/backupentry/actuator.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ package backupentry
import (
"context"
"fmt"
"strings"

"github.com/gardener/gardener/extensions/pkg/controller/backupentry/genericactuator"
"github.com/gardener/gardener/extensions/pkg/util"
v1beta1constants "github.com/gardener/gardener/pkg/apis/core/v1beta1/constants"
extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1"
"github.com/go-logr/logr"
"sigs.k8s.io/controller-runtime/pkg/client"
Expand Down Expand Up @@ -50,6 +52,6 @@ func (a *actuator) Delete(ctx context.Context, _ logr.Logger, be *extensionsv1al
if err != nil {
return util.DetermineError(err, helper.KnownCodes)
}

return util.DetermineError(openstackClient.DeleteObjectsWithPrefix(ctx, be.Spec.BucketName, fmt.Sprintf("%s/", be.Name)), helper.KnownCodes)
entryName := strings.TrimPrefix(be.Name, v1beta1constants.BackupSourcePrefix+"-")
return util.DetermineError(openstackClient.DeleteObjectsWithPrefix(ctx, be.Spec.BucketName, fmt.Sprintf("%s/", entryName)), helper.KnownCodes)
}

0 comments on commit e1b642f

Please sign in to comment.