Skip to content

Commit

Permalink
feat: add proxy for oss client Fixes #12313
Browse files Browse the repository at this point in the history
Signed-off-by: Jingkai Hung <[email protected]>
  • Loading branch information
jingkkkkai committed Sep 2, 2024
1 parent 5b4b8f6 commit 9d85eaa
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 @@ -84,6 +84,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 9d85eaa

Please sign in to comment.