Skip to content

Commit

Permalink
Switch backupbucket name generation to sha256
Browse files Browse the repository at this point in the history
  • Loading branch information
LucaBernstein committed Jun 25, 2024
1 parent 80e9743 commit e300de4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/controller/backupbucket/actuator.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ func (a *actuator) Reconcile(ctx context.Context, _ logr.Logger, backupBucket *e
return err
}

// If the generated secret in the backupbucket status not exists that means
// no backupbucket exists and it need to be created.
// If the generated secret in the backupbucket status does not exist that means
// no backupbucket exists and it needs to be created.
if backupBucket.Status.GeneratedSecretRef == nil {
storageAccountName, storageAccountKey, err := ensureBackupBucket(ctx, factory, backupBucket)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/backupbucket/backupbucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (

func ensureBackupBucket(ctx context.Context, factory azureclient.Factory, backupBucket *extensionsv1alpha1.BackupBucket) (string, string, error) {
var (
backupBucketNameSha = utils.ComputeSHA1Hex([]byte(backupBucket.Name))
backupBucketNameSha = utils.ComputeSHA256Hex([]byte(backupBucket.Name))
storageAccountName = fmt.Sprintf("bkp%s", backupBucketNameSha[:15])
)

Expand Down

0 comments on commit e300de4

Please sign in to comment.