Skip to content

Commit

Permalink
Set API timeout from ENV when credentials are specified in ENV (#625)
Browse files Browse the repository at this point in the history
Fixes bug with EXOSCALE_API_TIMEOUT being ignored when credentials are
specified in ENV.
  • Loading branch information
kobajagi authored Aug 8, 2024
1 parent 3852047 commit 5aa82b6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## Unreleased

### Bug Fixes

- Set API timeout from ENV when credentials are specified in ENV #625

## 1.78.5

### Improvements
Expand Down
7 changes: 7 additions & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,13 @@ func initConfig() { //nolint:gocyclo
account.CurrentAccount.SosEndpoint = sosEndpointFromEnv
}

clientTimeoutFromEnv := readFromEnv("EXOSCALE_API_TIMEOUT")
if clientTimeoutFromEnv != "" {
if t, err := strconv.Atoi(clientTimeoutFromEnv); err == nil {
account.CurrentAccount.ClientTimeout = t
}
}

account.GAllAccount = &account.Config{
DefaultAccount: account.CurrentAccount.Name,
Accounts: []account.Account{*account.CurrentAccount},
Expand Down

0 comments on commit 5aa82b6

Please sign in to comment.