mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-12 14:37:08 +08:00
vendor: update buildkit to v0.19.0-rc1
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
34
vendor/github.com/aws/aws-sdk-go-v2/config/shared_config.go
generated
vendored
34
vendor/github.com/aws/aws-sdk-go-v2/config/shared_config.go
generated
vendored
@ -115,6 +115,9 @@ const (
|
||||
requestMinCompressionSizeBytes = "request_min_compression_size_bytes"
|
||||
|
||||
s3DisableExpressSessionAuthKey = "s3_disable_express_session_auth"
|
||||
|
||||
accountIDKey = "aws_account_id"
|
||||
accountIDEndpointMode = "account_id_endpoint_mode"
|
||||
)
|
||||
|
||||
// defaultSharedConfigProfile allows for swapping the default profile for testing
|
||||
@ -341,6 +344,8 @@ type SharedConfig struct {
|
||||
// will only bypass the modified endpoint routing and signing behaviors
|
||||
// associated with the feature.
|
||||
S3DisableExpressAuth *bool
|
||||
|
||||
AccountIDEndpointMode aws.AccountIDEndpointMode
|
||||
}
|
||||
|
||||
func (c SharedConfig) getDefaultsMode(ctx context.Context) (value aws.DefaultsMode, ok bool, err error) {
|
||||
@ -1124,12 +1129,17 @@ func (c *SharedConfig) setFromIniSection(profile string, section ini.Section) er
|
||||
return fmt.Errorf("failed to load %s from shared config, %w", requestMinCompressionSizeBytes, err)
|
||||
}
|
||||
|
||||
if err := updateAIDEndpointMode(&c.AccountIDEndpointMode, section, accountIDEndpointMode); err != nil {
|
||||
return fmt.Errorf("failed to load %s from shared config, %w", accountIDEndpointMode, err)
|
||||
}
|
||||
|
||||
// Shared Credentials
|
||||
creds := aws.Credentials{
|
||||
AccessKeyID: section.String(accessKeyIDKey),
|
||||
SecretAccessKey: section.String(secretAccessKey),
|
||||
SessionToken: section.String(sessionTokenKey),
|
||||
Source: fmt.Sprintf("SharedConfigCredentials: %s", section.SourceFile[accessKeyIDKey]),
|
||||
AccountID: section.String(accountIDKey),
|
||||
}
|
||||
|
||||
if creds.HasKeys() {
|
||||
@ -1177,6 +1187,26 @@ func updateDisableRequestCompression(disable **bool, sec ini.Section, key string
|
||||
return nil
|
||||
}
|
||||
|
||||
func updateAIDEndpointMode(m *aws.AccountIDEndpointMode, sec ini.Section, key string) error {
|
||||
if !sec.Has(key) {
|
||||
return nil
|
||||
}
|
||||
|
||||
v := sec.String(key)
|
||||
switch v {
|
||||
case "preferred":
|
||||
*m = aws.AccountIDEndpointModePreferred
|
||||
case "required":
|
||||
*m = aws.AccountIDEndpointModeRequired
|
||||
case "disabled":
|
||||
*m = aws.AccountIDEndpointModeDisabled
|
||||
default:
|
||||
return fmt.Errorf("invalid value for shared config profile field, %s=%s, must be preferred/required/disabled", key, v)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c SharedConfig) getRequestMinCompressSizeBytes(ctx context.Context) (int64, bool, error) {
|
||||
if c.RequestMinCompressSizeBytes == nil {
|
||||
return 0, false, nil
|
||||
@ -1191,6 +1221,10 @@ func (c SharedConfig) getDisableRequestCompression(ctx context.Context) (bool, b
|
||||
return *c.DisableRequestCompression, true, nil
|
||||
}
|
||||
|
||||
func (c SharedConfig) getAccountIDEndpointMode(ctx context.Context) (aws.AccountIDEndpointMode, bool, error) {
|
||||
return c.AccountIDEndpointMode, len(c.AccountIDEndpointMode) > 0, nil
|
||||
}
|
||||
|
||||
func updateDefaultsMode(mode *aws.DefaultsMode, section ini.Section, key string) error {
|
||||
if !section.Has(key) {
|
||||
return nil
|
||||
|
Reference in New Issue
Block a user