From b50f45e1af2592ed72c21d533421f675742b1cf3 Mon Sep 17 00:00:00 2001 From: Deepak Gupta <70094361+yoursnerdly@users.noreply.github.com> Date: Sat, 9 Nov 2024 11:40:19 -0500 Subject: [PATCH 1/2] Do not clean local registry if CYRAL_SUPPORTED_REPOSITORIES is unset --- install-linux.sh | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/install-linux.sh b/install-linux.sh index 28130cc..6abf88c 100755 --- a/install-linux.sh +++ b/install-linux.sh @@ -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 From 8c588be7810d4c109f4bfa25b9cb5cd62ffacf8e Mon Sep 17 00:00:00 2001 From: Deepak Gupta <70094361+yoursnerdly@users.noreply.github.com> Date: Sat, 9 Nov 2024 11:43:20 -0500 Subject: [PATCH 2/2] Fix bug --- install-linux.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install-linux.sh b/install-linux.sh index 6abf88c..58f63ea 100755 --- a/install-linux.sh +++ b/install-linux.sh @@ -378,7 +378,7 @@ disable_unsupported_services() { cleanup_local_registry() { if command -v /opt/cyral/bin/cyral-local-discovery-cli &>/dev/null; then - if [[ -n "CYRAL_REPOSITORIES_SUPPORTED" ]]; then + 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)