Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not clean local registry if CYRAL_SUPPORTED_REPOSITORIES is unset #29

Merged
merged 2 commits into from
Nov 11, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
yoursnerdly marked this conversation as resolved.
Show resolved Hide resolved
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
Loading