Skip to content

Commit

Permalink
Remove unused envs
Browse files Browse the repository at this point in the history
Signed-off-by: Pierre-Emmanuel Jacquier <15922119+pierre-emmanuelJ@users.noreply.github.com>
  • Loading branch information
pierre-emmanuelJ committed Jan 18, 2024
1 parent ed6545a commit 27ac8e6
Showing 1 changed file with 2 additions and 22 deletions.
24 changes: 2 additions & 22 deletions v3/credentials/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,8 @@ func (e *EnvProvider) Retrieve() (Value, error) {
e.retrieved = false

v := Value{
APIKey: readFromEnv(
"EXOSCALE_API_KEY",
"EXOSCALE_KEY",
"CLOUDSTACK_KEY",
"CLOUDSTACK_API_KEY",
),
APISecret: readFromEnv(
"EXOSCALE_API_SECRET",
"EXOSCALE_SECRET",
"EXOSCALE_SECRET_KEY",
"CLOUDSTACK_SECRET",
"CLOUDSTACK_SECRET_KEY",
),
APIKey: os.Getenv("EXOSCALE_API_KEY"),
APISecret: os.Getenv("EXOSCALE_API_SECRET"),
}

if !v.IsSet() {
Expand All @@ -43,12 +32,3 @@ func (e *EnvProvider) Retrieve() (Value, error) {
func (e *EnvProvider) IsExpired() bool {
return !e.retrieved
}

func readFromEnv(keys ...string) string {
for _, key := range keys {
if value, ok := os.LookupEnv(key); ok {
return value
}
}
return ""
}

0 comments on commit 27ac8e6

Please # to comment.