mirror of
https://github.com/rocky-linux/peridot.git
synced 2024-11-18 11:21:25 +00:00
Merge pull request #140 from mstg/dualstack-yumrepofs
Enable dual stack for yumrepofs s3
This commit is contained in:
commit
1adc5d0b93
@ -19,6 +19,7 @@ go_library(
|
||||
"//utils",
|
||||
"//vendor/github.com/aws/aws-sdk-go/aws",
|
||||
"//vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds",
|
||||
"//vendor/github.com/aws/aws-sdk-go/aws/endpoints",
|
||||
"//vendor/github.com/aws/aws-sdk-go/aws/session",
|
||||
"//vendor/github.com/aws/aws-sdk-go/service/s3",
|
||||
"//vendor/github.com/go-git/go-billy/v5/osfs",
|
||||
|
@ -34,6 +34,7 @@ import (
|
||||
"context"
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/credentials/stscreds"
|
||||
"github.com/aws/aws-sdk-go/aws/endpoints"
|
||||
"github.com/aws/aws-sdk-go/aws/session"
|
||||
awss3 "github.com/aws/aws-sdk-go/service/s3"
|
||||
"github.com/go-git/go-billy/v5/osfs"
|
||||
@ -66,7 +67,9 @@ func NewServer(db peridotdb.Access, session *session.Session) (*Server, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
cfg := &aws.Config{}
|
||||
cfg := &aws.Config{
|
||||
UseDualStackEndpoint: endpoints.DualStackEndpointStateEnabled,
|
||||
}
|
||||
if assumeRole := viper.GetString("s3-assume-role"); assumeRole != "" {
|
||||
cfg.Credentials = stscreds.NewCredentials(session, assumeRole)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user