Skip to content

Commit dd56d4e

Browse files
committed
- implements IRSA inherit when we provide different serviceAccount and assume_role_arn in s3 config section, fix #1191
- add object labels configs to e2e integration tests Signed-off-by: Slach <[email protected]>
1 parent 01ed488 commit dd56d4e

File tree

5 files changed

+16
-0
lines changed

5 files changed

+16
-0
lines changed

ChangeLog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# v2.6.31
2+
IMPROVEMENTS
3+
- implements IRSA inherit when we provide different serviceAccount and `assume_role_arn` in `s3` config section, fix [1191](https://github.com/Altinity/clickhouse-backup/issues/1191)
4+
- add object labels configs to e2e integration tests
5+
16
# v2.6.30
27
IMPROVEMENTS
38
- add in REST API `operation_id` to result for all asynchronous commands (`create`,`upload`,`download`,`restore`) which allow poll /backup/status more precise, fix [1189](https://github.com/Altinity/clickhouse-backup/pull/1189), thanks @lepetitops

pkg/storage/s3.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,11 @@ func (s *S3) Connect(ctx context.Context) error {
135135
awsConfig.Credentials = stscreds.NewWebIdentityRoleProvider(
136136
stsClient, awsRoleARN, stscreds.IdentityTokenFile(awsWebIdentityTokenFile),
137137
)
138+
// inherit IRSA and try assume role https://github.com/Altinity/clickhouse-backup/issues/1191
139+
if s.Config.AssumeRoleARN != "" && s.Config.AssumeRoleARN != awsRoleARN {
140+
stsClient = sts.NewFromConfig(awsConfig)
141+
awsConfig.Credentials = stscreds.NewAssumeRoleProvider(stsClient, s.Config.AssumeRoleARN)
142+
}
138143
} else if s.Config.AssumeRoleARN != "" {
139144
// backup role S3_ASSUME_ROLE_ARN have high priority than AWS_ROLE_ARN see https://github.com/Altinity/clickhouse-backup/issues/898
140145
awsConfig.Credentials = stscreds.NewAssumeRoleProvider(stsClient, s.Config.AssumeRoleARN)

test/integration/config-gcs-custom-endpoint.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,5 @@ gcs:
2626
compression_format: tar
2727
endpoint: http://gcs:8080/storage/v1/
2828
skip_credentials: true
29+
object_labels:
30+
label: label_value

test/integration/config-gcs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,5 @@ gcs:
1818
object_disk_path: object_disks/{cluster}/{shard}
1919
credentials_file: /etc/clickhouse-backup/credentials.json
2020
compression_format: tar
21+
object_labels:
22+
label: label_value

test/integration/config-s3.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ s3:
4040
allow_multipart_download: true
4141
concurrency: 3
4242
request_payer: requester
43+
object_labels:
44+
label: label_value
4345
api:
4446
listen: :7171
4547
create_integration_tables: true

0 commit comments

Comments
 (0)