Skip to content

Commit

Permalink
Fix libetcd.sh handling for host and port
Browse files Browse the repository at this point in the history
Today, the host and port (after a refactor for chart versions 9.2.2 and later) are not being properly passed from `setup_etcd_active_endpoints` to `is_healthy_etcd_cluster`. As a result, the startup will fail complaining about `host` being unset for the line `remove_in_file "/snapshots/.disaster_recovery" "$host:$port"`.

This change fixes this behavior.

Signed-off-by: Kevin Cai <[email protected]>
  • Loading branch information
djkazic authored Aug 29, 2024
1 parent 317bcd2 commit d22de96
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ setup_etcd_active_endpoints() {
ETCD_ACTIVE_ENDPOINTS=$(echo "${active_endpoints_array[*]}" | tr ' ' ',')
export ETCD_ACTIVE_ENDPOINTS
fi
echo "${active_endpoints} ${cluster_size} ${ETCD_ACTIVE_ENDPOINTS}"
echo "${active_endpoints} ${cluster_size} ${ETCD_ACTIVE_ENDPOINTS} ${host} ${port}"
}

########################
Expand All @@ -462,7 +462,8 @@ setup_etcd_active_endpoints() {
is_healthy_etcd_cluster() {
local return_value=0
local active_endpoints cluster_size
read -r active_endpoints cluster_size ETCD_ACTIVE_ENDPOINTS <<<"$(setup_etcd_active_endpoints)"
local host port
read -r active_endpoints cluster_size ETCD_ACTIVE_ENDPOINTS host port <<<"$(setup_etcd_active_endpoints)"
export ETCD_ACTIVE_ENDPOINTS

if is_boolean_yes "$ETCD_DISASTER_RECOVERY"; then
Expand Down

0 comments on commit d22de96

Please sign in to comment.