From f60e16cb3f752aac7ce527a882e87a66b7723c4f Mon Sep 17 00:00:00 2001 From: crssnd Date: Fri, 20 Oct 2023 09:03:47 +0200 Subject: [PATCH] apps sc: Fixed the update-ips for sync default buckets false --- bin/update-ips.bash | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/bin/update-ips.bash b/bin/update-ips.bash index 6890bc6c2..55ef1bcac 100755 --- a/bin/update-ips.bash +++ b/bin/update-ips.bash @@ -394,10 +394,16 @@ fi ## Add destination object storage ips for rclone sync to sc config if [ "$(yq_dig 'sc' '.objectStorage.sync.enabled' 'false')" == "true" ]; then if [ "$(yq_dig 'sc' '.networkPolicies.rcloneSync.enabled' 'false')" == "true" ]; then - check_harbor="$(yq_dig 'sc' '.harbor.persistence.type' 'false')" - check_thanos="$(yq_dig 'sc' '.thanos.objectStorage.type' 'false')" - destination=$(yq4 '.objectStorage.sync.buckets.[].destinationType' "${config["override_sc"]}") + check_sync_default_buckets="$(yq_dig 'sc' '.objectStorage.sync.syncDefaultBuckets' 'false')" destinationSwift=false + if [ "${check_sync_default_buckets}" == "true" ]; then + check_harbor="$(yq_dig 'sc' '.harbor.persistence.type' 'false')" + check_thanos="$(yq_dig 'sc' '.thanos.objectStorage.type' 'false')" + if [ "$check_harbor" == "swift" ] || [ "$check_thanos" == "swift" ]; then + destinationSwift=true + fi + fi + destination=$(yq4 '.objectStorage.sync.buckets.[].destinationType' "${config["override_sc"]}") destinationS3=false for type in $destination; do if [ "$type" == "swift" ]; then @@ -406,9 +412,6 @@ if [ "$(yq_dig 'sc' '.objectStorage.sync.enabled' 'false')" == "true" ]; then destinationS3=true fi done - if [ "$check_harbor" == "swift" ] || [ "$check_thanos" == "swift" ]; then - destinationSwift=true - fi ifNull="" S3_ENDPOINT_DST="$(yq_dig 'sc' '.objectStorage.sync.s3.regionEndpoint' "" | sed 's/https\?:\/\///' | sed 's/[:\/].*//')"