From 0766812a2686ec2b091c84bf7fcf822f36f6186a Mon Sep 17 00:00:00 2001 From: Felix Kunde Date: Thu, 5 Sep 2024 07:14:01 +0200 Subject: [PATCH] fix tagging --- postgres-appliance/scripts/upload_pg_log_to_s3.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/postgres-appliance/scripts/upload_pg_log_to_s3.py b/postgres-appliance/scripts/upload_pg_log_to_s3.py index 7e43573b..61c6e19b 100755 --- a/postgres-appliance/scripts/upload_pg_log_to_s3.py +++ b/postgres-appliance/scripts/upload_pg_log_to_s3.py @@ -64,13 +64,13 @@ def upload_to_s3(local_file_path): chunk_size = 52428800 # 50 MiB config = TransferConfig(multipart_threshold=chunk_size, multipart_chunksize=chunk_size) tags = { - 'LogEndpoint': os.getenv('LOG_S3_ENDPOINT'), 'Namespace': os.getenv('POD_NAMESPACE'), 'ClusterName': os.getenv('SCOPE') } + tags_str = "&".join(f"{key}={value}" for key, value in tags.items()) try: - bucket.upload_file(local_file_path, key_name, Config=config, ExtraArgs=tags) + bucket.upload_file(local_file_path, key_name, Config=config, ExtraArgs={'Tagging': tags_str}) except S3UploadFailedError as e: logger.exception('Failed to upload the %s to the bucket %s under the key %s. Exception: %r', local_file_path, bucket_name, key_name, e)