Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SNOW-996678 Use snowflakeTransport for all clouds #1018

Merged
merged 1 commit into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions azure_storage_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ func (util *snowflakeAzureClient) createClient(info *execResponseStageInfo, _ bo
MaxRetries: 60,
RetryDelay: 2 * time.Second,
},
Transport: &http.Client{
Transport: SnowflakeTransport,
},
},
})
if err != nil {
Expand Down
15 changes: 9 additions & 6 deletions gcs_storage_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ func (util *snowflakeGcsClient) getFileHeader(meta *fileMetadata, filename strin
for k, v := range gcsHeaders {
req.Header.Add(k, v)
}
var client gcsAPI
client = &http.Client{}
client := newGcsClient()
// for testing only
if meta.mockGcsClient != nil {
client = meta.mockGcsClient
Expand Down Expand Up @@ -216,8 +215,7 @@ func (util *snowflakeGcsClient) uploadFile(
for k, v := range gcsHeaders {
req.Header.Add(k, v)
}
var client gcsAPI
client = &http.Client{}
client := newGcsClient()
// for testing only
if meta.mockGcsClient != nil {
client = meta.mockGcsClient
Expand Down Expand Up @@ -295,8 +293,7 @@ func (util *snowflakeGcsClient) nativeDownloadFile(
for k, v := range gcsHeaders {
req.Header.Add(k, v)
}
var client gcsAPI
client = &http.Client{}
client := newGcsClient()
// for testing only
if meta.mockGcsClient != nil {
client = meta.mockGcsClient
Expand Down Expand Up @@ -390,3 +387,9 @@ func (util *snowflakeGcsClient) generateFileURL(stageLocation string, filename s
func (util *snowflakeGcsClient) isTokenExpired(resp *http.Response) bool {
return resp.StatusCode == 401
}

func newGcsClient() gcsAPI {
sfc-gh-dheyman marked this conversation as resolved.
Show resolved Hide resolved
return &http.Client{
Transport: SnowflakeTransport,
}
}
4 changes: 4 additions & 0 deletions s3_storage_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"errors"
"fmt"
"io"
"net/http"
"os"
"strings"

Expand Down Expand Up @@ -52,6 +53,9 @@ func (util *snowflakeS3Client) createClient(info *execResponseStageInfo, useAcce
stageCredentials.AwsToken)),
EndpointResolver: resolver,
UseAccelerate: useAccelerateEndpoint,
HTTPClient: &http.Client{
Transport: SnowflakeTransport,
},
}), nil
}

Expand Down
Loading