From e9661bb77b6d728eb14a6bf33e837d838a705c38 Mon Sep 17 00:00:00 2001 From: Siavash Date: Wed, 20 Nov 2024 10:28:10 +0000 Subject: [PATCH] [bitnami/scylladb] Uncomment cassandra rack and dc lines in libscylladb.sh Fix an issue where custom values for data center and rack are ignored because the lines are left as comment in cassandra-rackdc.properties file. Signed-off-by: Siavash --- .../6.0/debian-12/rootfs/opt/bitnami/scripts/libscylladb.sh | 4 ++-- .../6.1/debian-12/rootfs/opt/bitnami/scripts/libscylladb.sh | 4 ++-- .../6.2/debian-12/rootfs/opt/bitnami/scripts/libscylladb.sh | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bitnami/scylladb/6.0/debian-12/rootfs/opt/bitnami/scripts/libscylladb.sh b/bitnami/scylladb/6.0/debian-12/rootfs/opt/bitnami/scripts/libscylladb.sh index 7bf0faedc229d..18987e6c589fe 100644 --- a/bitnami/scylladb/6.0/debian-12/rootfs/opt/bitnami/scripts/libscylladb.sh +++ b/bitnami/scylladb/6.0/debian-12/rootfs/opt/bitnami/scripts/libscylladb.sh @@ -797,8 +797,8 @@ cassandra_setup_common_ports() { ######################### cassandra_setup_rack_dc() { if ! cassandra_is_file_external "${DB_MOUNTED_RACKDC_PATH}"; then - replace_in_file "${DB_RACKDC_FILE}" "dc=.*" "dc=${DB_DATACENTER}" - replace_in_file "${DB_RACKDC_FILE}" "rack=.*" "rack=${DB_RACK}" + replace_in_file "${DB_RACKDC_FILE}" "^(#\s)?(\s*)dc=.*" "dc=${DB_DATACENTER}" + replace_in_file "${DB_RACKDC_FILE}" "^(#\s)?(\s*)rack=.*" "rack=${DB_RACK}" else debug "${DB_MOUNTED_RACKDC_PATH} mounted. Skipping rack and datacenter configuration" fi diff --git a/bitnami/scylladb/6.1/debian-12/rootfs/opt/bitnami/scripts/libscylladb.sh b/bitnami/scylladb/6.1/debian-12/rootfs/opt/bitnami/scripts/libscylladb.sh index 7bf0faedc229d..18987e6c589fe 100644 --- a/bitnami/scylladb/6.1/debian-12/rootfs/opt/bitnami/scripts/libscylladb.sh +++ b/bitnami/scylladb/6.1/debian-12/rootfs/opt/bitnami/scripts/libscylladb.sh @@ -797,8 +797,8 @@ cassandra_setup_common_ports() { ######################### cassandra_setup_rack_dc() { if ! cassandra_is_file_external "${DB_MOUNTED_RACKDC_PATH}"; then - replace_in_file "${DB_RACKDC_FILE}" "dc=.*" "dc=${DB_DATACENTER}" - replace_in_file "${DB_RACKDC_FILE}" "rack=.*" "rack=${DB_RACK}" + replace_in_file "${DB_RACKDC_FILE}" "^(#\s)?(\s*)dc=.*" "dc=${DB_DATACENTER}" + replace_in_file "${DB_RACKDC_FILE}" "^(#\s)?(\s*)rack=.*" "rack=${DB_RACK}" else debug "${DB_MOUNTED_RACKDC_PATH} mounted. Skipping rack and datacenter configuration" fi diff --git a/bitnami/scylladb/6.2/debian-12/rootfs/opt/bitnami/scripts/libscylladb.sh b/bitnami/scylladb/6.2/debian-12/rootfs/opt/bitnami/scripts/libscylladb.sh index 7bf0faedc229d..18987e6c589fe 100644 --- a/bitnami/scylladb/6.2/debian-12/rootfs/opt/bitnami/scripts/libscylladb.sh +++ b/bitnami/scylladb/6.2/debian-12/rootfs/opt/bitnami/scripts/libscylladb.sh @@ -797,8 +797,8 @@ cassandra_setup_common_ports() { ######################### cassandra_setup_rack_dc() { if ! cassandra_is_file_external "${DB_MOUNTED_RACKDC_PATH}"; then - replace_in_file "${DB_RACKDC_FILE}" "dc=.*" "dc=${DB_DATACENTER}" - replace_in_file "${DB_RACKDC_FILE}" "rack=.*" "rack=${DB_RACK}" + replace_in_file "${DB_RACKDC_FILE}" "^(#\s)?(\s*)dc=.*" "dc=${DB_DATACENTER}" + replace_in_file "${DB_RACKDC_FILE}" "^(#\s)?(\s*)rack=.*" "rack=${DB_RACK}" else debug "${DB_MOUNTED_RACKDC_PATH} mounted. Skipping rack and datacenter configuration" fi