Skip to content

Commit

Permalink
fix(rdb): fix nil DownloadURL lookup in backup (#3952)
Browse files Browse the repository at this point in the history
  • Loading branch information
jremy42 authored Jul 3, 2024
1 parent d8b9f04 commit 8f03253
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/namespaces/rdb/v1/custom_backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ func backupDownloadCommand() *core.Command {
Timeout: scw.TimeDurationPtr(backupActionTimeout),
RetryInterval: core.DefaultRetryInterval,
}

backup, err := api.WaitForDatabaseBackup(backupRequest)
if err != nil {
return nil, err
Expand Down Expand Up @@ -320,6 +321,11 @@ func backupDownloadCommand() *core.Command {
}

httpClient := core.ExtractHTTPClient(ctx)

if backup.DownloadURL == nil {
return nil, fmt.Errorf("download URL is still nil after export")
}

res, err := httpClient.Get(*backup.DownloadURL)
if err != nil {
return nil, err
Expand Down

0 comments on commit 8f03253

Please sign in to comment.