Skip to content

Commit

Permalink
chore: use env https_proxy as oss client option proxy_host #12313 (#1…
Browse files Browse the repository at this point in the history
…2383)

Signed-off-by: Jingkai Hung <jkhung@netbasequid.com>
  • Loading branch information
jingkkkkai committed Sep 10, 2024
1 parent ed3b8ce commit 7fee019
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions workflow/artifacts/oss/oss.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,13 @@ func (p *ossCredentialsProvider) GetCredentials() oss.Credentials {

func (ossDriver *ArtifactDriver) newOSSClient() (*oss.Client, error) {
var options []oss.ClientOption

// for oss driver, the proxy cannot be configured through environment variables
// ref: https://help.aliyun.com/zh/cli/use-an-http-proxy-server#section-5yf-ejl-jwf
if proxy, ok := os.LookupEnv("https_proxy"); ok {
options = append(options, oss.Proxy(proxy))
}

if token := ossDriver.SecurityToken; token != "" {
options = append(options, oss.SecurityToken(token))
}
Expand Down

0 comments on commit 7fee019

Please sign in to comment.