Skip to content

Commit

Permalink
apps sc: Fixed the update-ips for sync default buckets false
Browse files Browse the repository at this point in the history
  • Loading branch information
crssnd authored and crssnd committed Oct 20, 2023
1 parent cad0899 commit f60e16c
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions bin/update-ips.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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/[:\/].*//')"
Expand Down

0 comments on commit f60e16c

Please sign in to comment.