Skip to content

Commit

Permalink
Do not clean local registry if CYRAL_SUPPORTED_REPOSITORIES is unset (#…
Browse files Browse the repository at this point in the history
…29)

* Do not clean local registry if CYRAL_SUPPORTED_REPOSITORIES is unset

* Fix bug
  • Loading branch information
yoursnerdly authored Nov 11, 2024
1 parent 8bf19b1 commit eaf720a
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions install-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -378,15 +378,16 @@ disable_unsupported_services() {

cleanup_local_registry() {
if command -v /opt/cyral/bin/cyral-local-discovery-cli &>/dev/null; then
echo "Cleaning up local registry"
readarray -t WIRES < <(find /etc/cyral/ -type d -name "*-wire" -printf "%f\n")
wires_to_disable=$(for wire in "${WIRES[@]}"; do if [[ ! "$CYRAL_REPOSITORIES_SUPPORTED" =~ $(echo "$wire" | cut -d- -f2) ]]; then echo -n "$wire "; fi; done)
for wire in "${WIRES[@]}"; do
if [[ -n "$wires_to_disable" ]] && [[ " ${wires_to_disable} " == *" ${wire} "* ]]; then
/opt/cyral/bin/cyral-local-discovery-cli unregister "${wire#cyral-}" --db "$CYRAL_REGISTRY_DATABASE" --bucket "$CYRAL_REGISTRY_BUCKET"
fi
done

if [[ -n "$CYRAL_REPOSITORIES_SUPPORTED" ]]; then
echo "Cleaning up local registry"
readarray -t WIRES < <(find /etc/cyral/ -type d -name "*-wire" -printf "%f\n")
wires_to_disable=$(for wire in "${WIRES[@]}"; do if [[ ! "$CYRAL_REPOSITORIES_SUPPORTED" =~ $(echo "$wire" | cut -d- -f2) ]]; then echo -n "$wire "; fi; done)
for wire in "${WIRES[@]}"; do
if [[ -n "$wires_to_disable" ]] && [[ " ${wires_to_disable} " == *" ${wire} "* ]]; then
/opt/cyral/bin/cyral-local-discovery-cli unregister "${wire#cyral-}" --db "$CYRAL_REGISTRY_DATABASE" --bucket "$CYRAL_REGISTRY_BUCKET"
fi
done
fi
if [[ "$CYRAL_STORAGE_MANAGER_PROXY_ENABLED" != "true" ]]; then
/opt/cyral/bin/cyral-local-discovery-cli unregister "storage-proxy" --db "$CYRAL_REGISTRY_DATABASE" --bucket "$CYRAL_REGISTRY_BUCKET" 2>/dev/null || true
fi
Expand Down

0 comments on commit eaf720a

Please sign in to comment.