Skip to content

Commit

Permalink
More cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
simonklb committed Nov 16, 2023
1 parent 7774c82 commit f0ff3a6
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions bin/update-ips.bash
Original file line number Diff line number Diff line change
Expand Up @@ -98,22 +98,12 @@ yq_eval() {

# Determine if Swift is enabled in the configuration.
swift_enabled() {
local check_harbor
local check_thanos
local bucket_source_types

check_harbor="$(yq_read "sc" '.harbor.persistence.type' "false")"
check_thanos="$(yq_read "sc" '.thanos.objectStorage.type' "false")"
bucket_source_types=$(yq_read "sc" '.objectStorage.sync.buckets.[].sourceType' "")

local source_swift=false
for bucket_type in ${bucket_source_types}; do
if [ "${bucket_type}" == "swift" ]; then
source_swift=true
fi
[ "$(yq_read "sc" '.harbor.persistence.type' "false")" = "swift" ] && return 0
[ "$(yq_read "sc" '.thanos.objectStorage.type' "false")" = "swift" ] && return 0
for source_type in $(yq_read "sc" '.objectStorage.sync.buckets.[].sourceType' ""); do
[ "${source_type}" = "swift" ] && return 0
done

[ "${check_harbor}" == "swift" ] || [ "${check_thanos}" == "swift" ] || [ "${source_swift}" == "true" ]
return 1
}

# Determine if Rsync is enabled in the configuration.
Expand Down

0 comments on commit f0ff3a6

Please sign in to comment.