Skip to content

Commit

Permalink
lib: do not update default client configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
JacksonTian committed Mar 26, 2024
1 parent 44a8a7b commit ea6c47e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 3 additions & 2 deletions sdk/auth/credentials/provider/instance_credentials.go
Expand Up @@ -68,8 +68,9 @@ func (p *InstanceCredentialsProvider) Resolve() (auth.Credential, error) {
}

func get(url string) (status int, content []byte, err error) {
httpClient := http.DefaultClient
httpClient.Timeout = 1 * time.Second
httpClient := &http.Client{
Timeout: 1 * time.Second,
}
resp, err := httpClient.Get(url)
if err != nil {
return
Expand Down
5 changes: 4 additions & 1 deletion sdk/auth/credentials/provider/provider_chain.go
Expand Up @@ -24,9 +24,12 @@ func (p *ProviderChain) Resolve() (auth.Credential, error) {
creds, err := provider.Resolve()
if err != nil {
return nil, err
} else if err == nil && creds == nil {
}

if creds == nil {
continue
}

return creds, err
}
return nil, errors.New("No credential found")
Expand Down

0 comments on commit ea6c47e

Please sign in to comment.