Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 6.2] fix(bucket-locations): add templating to backup_bucket_location #9807

Merged
merged 1 commit into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion defaults/aws_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ ami_id_db_oracle: ''
use_preinstalled_scylla: true

backup_bucket_backend: 's3'
backup_bucket_location: 'manager-backup-tests-us-east-1'
backup_bucket_location: 'manager-backup-tests-{region}'

data_volume_disk_num: 0
data_volume_disk_type: 'gp2'
Expand Down
3 changes: 2 additions & 1 deletion functional_tests/scylla_operator/test_functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,8 @@ def test_mgmt_backup(db_cluster, manager_version):

# Run manager backup operation
mgr_cluster = db_cluster.get_cluster_manager()
backup_bucket_location = db_cluster.params.get('backup_bucket_location')
region = next(iter(db_cluster.params.region_names), '')
backup_bucket_location = db_cluster.params.get('backup_bucket_location').format(region=region)
bucket_name = f"s3:{backup_bucket_location.split()[0]}"
mgr_task = mgr_cluster.create_backup_task(location_list=[bucket_name, ])
assert mgr_task, "Failed to create backup task"
Expand Down
3 changes: 2 additions & 1 deletion mgmt_cli_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,8 @@ def test_restore_multiple_backup_snapshots(self): # pylint: disable=too-many-lo
self.log.error("Test supports only AWS ATM")
return
persistent_manager_snapshots_dict = get_persistent_snapshots()
target_bucket = persistent_manager_snapshots_dict[cluster_backend]["bucket"]
region = next(iter(self.params.region_names), '')
target_bucket = persistent_manager_snapshots_dict[cluster_backend]["bucket"].format(region=region)
backup_bucket_backend = self.params.get("backup_bucket_backend")
location_list = [f"{backup_bucket_backend}:{target_bucket}"]
confirmation_stress_template = persistent_manager_snapshots_dict[cluster_backend]["confirmation_stress_template"]
Expand Down
3 changes: 2 additions & 1 deletion sdcm/nemesis.py
Original file line number Diff line number Diff line change
Expand Up @@ -3127,7 +3127,8 @@ def _mgmt_backup(self, backup_specific_tables):
raise UnsupportedNemesis('backup bucket location configuration is not defined!')

backup_bucket_backend = self.cluster.params.get("backup_bucket_backend")
backup_bucket_location = self.cluster.params.get("backup_bucket_location")
region = next(iter(self.cluster.params.region_names), '')
backup_bucket_location = self.cluster.params.get("backup_bucket_location").format(region=region)
location = f"{backup_bucket_backend}:{backup_bucket_location.split()[0]}"
self._delete_existing_backups(mgr_cluster)
if backup_specific_tables:
Expand Down