diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c3b79527..cb22b8d59 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## [master](https://github.com/arangodb/kube-arangodb/tree/master) (N/A) - (Feature) Allow configuration for securityContext.runAsUser value - (Bugfix) Fix Satellite collections in Agency +- (Bugfix) Fix backup creation timeout ## [1.2.9](https://github.com/arangodb/kube-arangodb/tree/1.2.9) (2022-03-30) - (Feature) Improve Kubernetes clientsets management diff --git a/pkg/handlers/backup/arango_client_impl.go b/pkg/handlers/backup/arango_client_impl.go index 5bf91a64e..d3d5417ed 100644 --- a/pkg/handlers/backup/arango_client_impl.go +++ b/pkg/handlers/backup/arango_client_impl.go @@ -75,8 +75,7 @@ func (ac *arangoClientBackupImpl) List() (map[driver.BackupID]driver.BackupMeta, } func (ac *arangoClientBackupImpl) Create() (ArangoBackupCreateResponse, error) { - ctx, cancel := context.WithTimeout(context.Background(), defaultArangoClientTimeout) - defer cancel() + dt := defaultArangoClientTimeout co := driver.BackupCreateOptions{} @@ -86,9 +85,13 @@ func (ac *arangoClientBackupImpl) Create() (ArangoBackupCreateResponse, error) { } if timeout := opt.Timeout; timeout != nil { co.Timeout = time.Duration(*timeout * float32(time.Second)) + dt += co.Timeout } } + ctx, cancel := context.WithTimeout(context.Background(), dt) + defer cancel() + id, resp, err := ac.driver.Backup().Create(ctx, &co) if err != nil { return ArangoBackupCreateResponse{}, err