Skip to content

Commit d46e6b4

Browse files
Fix for AssumeRole credential insertion (#948)
1 parent 3f00cf8 commit d46e6b4

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

pkg/config/storage.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,18 +58,18 @@ func (p *PipelineConfig) getStorageConfig(req egress.UploadRequest) (*StorageCon
5858
sc.S3.MaxRetries = p.StorageConfig.S3.MaxRetries
5959
sc.S3.MaxRetryDelay = p.StorageConfig.S3.MaxRetryDelay
6060
sc.S3.MinRetryDelay = p.StorageConfig.S3.MinRetryDelay
61-
62-
if sc.S3.AssumeRoleArn != "" && sc.S3.AccessKey == "" {
63-
if p.S3AssumeRoleKey != "" {
64-
// If an AssummedRole is set but not any AccessKey, default to using the one from conf. This is usefull for uploading to S3
65-
// using an external account.
66-
sc.S3.AccessKey = p.S3AssumeRoleKey
67-
sc.S3.Secret = p.S3AssumeRoleSecret
68-
} else {
69-
return nil, errors.ErrFeatureDisabled("S3 upload using AssumeRole")
70-
}
61+
}
62+
if sc.S3.AssumeRoleArn != "" && sc.S3.AccessKey == "" {
63+
if p.S3AssumeRoleKey != "" {
64+
// If an AssummedRole is set but not any AccessKey, default to using the one from conf. This is usefull for uploading to S3
65+
// using an external account.
66+
sc.S3.AccessKey = p.S3AssumeRoleKey
67+
sc.S3.Secret = p.S3AssumeRoleSecret
68+
} else {
69+
return nil, errors.ErrFeatureDisabled("S3 upload using AssumeRole")
7170
}
7271
}
72+
7373
if s3.Proxy != nil {
7474
sc.S3.ProxyConfig = &storage.ProxyConfig{
7575
Url: s3.Proxy.Url,

0 commit comments

Comments
 (0)