diff --git a/bitnami/etcd/3/debian-10/Dockerfile b/bitnami/etcd/3/debian-10/Dockerfile index 1f6680beb1b5..15534efe0633 100644 --- a/bitnami/etcd/3/debian-10/Dockerfile +++ b/bitnami/etcd/3/debian-10/Dockerfile @@ -17,7 +17,7 @@ RUN chmod g+rwX /opt/bitnami COPY rootfs / RUN /opt/bitnami/scripts/etcd/postunpack.sh ENV BITNAMI_APP_NAME="etcd" \ - BITNAMI_IMAGE_VERSION="3.5.1-debian-10-r9" \ + BITNAMI_IMAGE_VERSION="3.5.1-debian-10-r10" \ ETCDCTL_API="3" EXPOSE 2379 2380 diff --git a/bitnami/etcd/3/debian-10/rootfs/opt/bitnami/scripts/libetcd.sh b/bitnami/etcd/3/debian-10/rootfs/opt/bitnami/scripts/libetcd.sh index fc0d05386126..03d0d9991853 100644 --- a/bitnami/etcd/3/debian-10/rootfs/opt/bitnami/scripts/libetcd.sh +++ b/bitnami/etcd/3/debian-10/rootfs/opt/bitnami/scripts/libetcd.sh @@ -143,8 +143,10 @@ etcdctl_get_endpoints() { fi fi done + echo "${endpoints[*]}" | tr ' ' ',' + else + echo "" fi - echo "${endpoints[*]}" | tr ' ' ',' } ######################## @@ -271,14 +273,16 @@ is_healthy_etcd_cluster() { local -r cluster_size=${#endpoints_array[@]} host="$(parse_uri "$ETCD_ADVERTISE_CLIENT_URLS" "host")" port="$(parse_uri "$ETCD_ADVERTISE_CLIENT_URLS" "port")" - for e in "${endpoints_array[@]}"; do - read -r -a extra_flags <<< "$(etcdctl_auth_flags)" - extra_flags+=("--endpoints=$e") - if [[ "$e" != "$host:$port" ]] && etcdctl endpoint health "${extra_flags[@]}" >/dev/null 2>&1; then - debug "$e endpoint is active" - ((active_endpoints++)) - fi - done + if [[ $cluster_size -gt 0 ]]; then + for e in "${endpoints_array[@]}"; do + read -r -a extra_flags <<< "$(etcdctl_auth_flags)" + extra_flags+=("--endpoints=$e") + if [[ "$e" != "$host:$port" ]] && etcdctl endpoint health "${extra_flags[@]}" >/dev/null 2>&1; then + debug "$e endpoint is active" + ((active_endpoints++)) + fi + done + fi if is_boolean_yes "$ETCD_DISASTER_RECOVERY"; then if [[ -f "/snapshots/.disaster_recovery" ]]; then diff --git a/bitnami/etcd/README.md b/bitnami/etcd/README.md index 85b3c200e103..7fa1b615cdba 100644 --- a/bitnami/etcd/README.md +++ b/bitnami/etcd/README.md @@ -44,7 +44,7 @@ Non-root container images add an extra layer of security and are generally recom Learn more about the Bitnami tagging policy and the difference between rolling tags and immutable tags [in our documentation page](https://docs.bitnami.com/tutorials/understand-rolling-tags-containers/). -* [`3`, `3-debian-10`, `3.5.1`, `3.5.1-debian-10-r9`, `latest` (3/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-etcd/blob/3.5.1-debian-10-r9/3/debian-10/Dockerfile) +* [`3`, `3-debian-10`, `3.5.1`, `3.5.1-debian-10-r10`, `latest` (3/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-etcd/blob/3.5.1-debian-10-r10/3/debian-10/Dockerfile) Subscribe to project updates by watching the [bitnami/etcd GitHub repo](https://github.com/bitnami/bitnami-docker-etcd).