3.5.4-debian-11-r7 release

This commit is contained in:
Bitnami Bot 2022-06-24 01:42:02 +00:00 committed by Bitnami Containers
parent 1658da24e0
commit 9c96ec9ea8
5 changed files with 21 additions and 22 deletions

View File

@ -1,12 +1,11 @@
FROM docker.io/bitnami/minideb:bullseye
LABEL maintainer "Bitnami <containers@bitnami.com>"
ENV HOME="/" \
OS_ARCH="amd64" \
OS_FLAVOUR="debian-11" \
OS_NAME="linux"
COPY prebuildfs /
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# Install required system packages and dependencies
RUN install_packages acl ca-certificates curl gzip procps tar
RUN . /opt/bitnami/scripts/libcomponent.sh && component_unpack "yq" "4.25.2-150" --checksum 58fc2dcc9eda8b5e88ef23081c14384a33ac4736d7238d490416fb4c5c633994

View File

@ -31,6 +31,8 @@ etcd_env_vars=(
ETCD_ON_K8S
ETCD_INIT_SNAPSHOT_FILENAME
ETCDCTL_API
ETCD_DISABLE_STORE_MEMBER_ID
ETCD_DISABLE_PRESTOP
ETCD_NAME
ETCD_LOG_LEVEL
ETCD_LISTEN_CLIENT_URLS
@ -86,6 +88,8 @@ export ETCD_DISASTER_RECOVERY="${ETCD_DISASTER_RECOVERY:-no}"
export ETCD_ON_K8S="${ETCD_ON_K8S:-no}"
export ETCD_INIT_SNAPSHOT_FILENAME="${ETCD_INIT_SNAPSHOT_FILENAME:-}"
export ETCDCTL_API="${ETCDCTL_API:-3}"
export ETCD_DISABLE_STORE_MEMBER_ID="${ETCD_DISABLE_STORE_MEMBER_ID:-no}"
export ETCD_DISABLE_PRESTOP="${ETCD_DISABLE_PRESTOP:-no}"
# etcd native environment variables (see https://etcd.io/docs/current/op-guide/configuration)
export ETCD_NAME="${ETCD_NAME:-}"

View File

@ -1,7 +1,6 @@
#!/bin/bash
# shellcheck disable=SC1091
set -o errexit
set -o pipefail
set -o nounset
@ -21,10 +20,10 @@ endpoints="$(etcdctl_get_endpoints true)"
if is_empty_value "${endpoints}"; then
exit 0
fi
read -r -a extra_flags <<< "$(etcdctl_auth_flags)"
read -r -a extra_flags <<<"$(etcdctl_auth_flags)"
extra_flags+=("--endpoints=${endpoints}" "--debug=true")
# We use 'sync' to ensure memory buffers are flushed to disk
# so we reduce the chances that the "member_removal.log" file is empty.
# ref: https://man7.org/linux/man-pages/man1/sync.1.html
etcdctl member remove "$(get_member_id)" "${extra_flags[@]}" > "$(dirname "$ETCD_DATA_DIR")/member_removal.log"
etcdctl member remove "$(get_member_id)" "${extra_flags[@]}" >"$(dirname "$ETCD_DATA_DIR")/member_removal.log"
sync -d "$(dirname "$ETCD_DATA_DIR")/member_removal.log"

View File

@ -292,7 +292,7 @@ etcdctl_auth_flags() {
[[ -f "$ETCD_CERT_FILE" ]] && [[ -f "$ETCD_KEY_FILE" ]] && authFlags+=("--cert" "$ETCD_CERT_FILE" "--key" "$ETCD_KEY_FILE")
[[ -f "$ETCD_TRUSTED_CA_FILE" ]] && authFlags+=("--cacert" "$ETCD_TRUSTED_CA_FILE")
fi
echo "${authFlags[@]:-}"
echo "${authFlags[@]}"
}
########################
@ -314,10 +314,10 @@ etcd_store_member_id() {
etcd_start_bg
read -r -a extra_flags <<<"$(etcdctl_auth_flags)"
is_boolean_yes "$ETCD_ON_K8S" && extra_flags+=("--endpoints=$(etcdctl_get_endpoints)")
if retry_while "etcdctl ${extra_flags[*]:-} member list" >/dev/null 2>&1; then
if retry_while "etcdctl ${extra_flags[*]} member list" >/dev/null 2>&1; then
while is_empty_value "$member_id"; do
read -r -a advertised_array <<<"$(tr ',;' ' ' <<<"$ETCD_ADVERTISE_CLIENT_URLS")"
member_id="$(etcdctl "${extra_flags[@]:-}" member list | grep -w "${advertised_array[0]}" | awk -F "," '{ print $1}' || true)"
member_id="$(etcdctl "${extra_flags[@]}" member list | grep -w "${advertised_array[0]}" | awk -F "," '{ print $1}' || true)"
done
# We use 'sync' to ensure memory buffers are flushed to disk
# so we reduce the chances that the "member_id" file is empty.
@ -704,7 +704,7 @@ etcd_initialize() {
#########################
add_self_to_cluster() {
local -a extra_flags
read -r -a extra_flags <<< "$(etcdctl_auth_flags)"
read -r -a extra_flags <<<"$(etcdctl_auth_flags)"
# is_healthy_etcd_cluster will also set ETCD_ACTIVE_ENDPOINTS
while ! is_healthy_etcd_cluster; do
warn "Cluster not healthy, not adding self to cluster for now, keeping trying..."
@ -715,7 +715,7 @@ add_self_to_cluster() {
if is_empty_value "$(get_member_id)"; then
extra_flags+=("--endpoints=${ETCD_ACTIVE_ENDPOINTS}" "--peer-urls=$ETCD_INITIAL_ADVERTISE_PEER_URLS")
while ! etcdctl member add "$ETCD_NAME" "${extra_flags[@]}" | grep "^ETCD_" > "$ETCD_NEW_MEMBERS_ENV_FILE"; do
while ! etcdctl member add "$ETCD_NAME" "${extra_flags[@]}" | grep "^ETCD_" >"$ETCD_NEW_MEMBERS_ENV_FILE"; do
warn "Failed to add self to cluster, keeping trying..."
sleep 10
done
@ -739,27 +739,24 @@ add_self_to_cluster() {
#########################
get_member_id() {
if ! is_boolean_yes "$ETCD_DISABLE_STORE_MEMBER_ID"; then
if ! -s "${ETCD_DATA_DIR}/member_id"; then
echo ""
if [[ ! -s "${ETCD_DATA_DIR}/member_id" ]]; then
echo ""
return 0
fi
cat "${ETCD_DATA_DIR}/member_id"
return 0
fi
ETCD_ACTIVE_ENDPOINTS=${ETCD_ACTIVE_ENDPOINTS:-}
if is_empty_value "$ETCD_ACTIVE_ENDPOINTS"; then
is_healthy_etcd_cluster
fi
local ret
local -a extra_flags
read -r -a extra_flags <<< "$(etcdctl_auth_flags)"
read -r -a extra_flags <<<"$(etcdctl_auth_flags)"
extra_flags+=("--endpoints=${ETCD_ACTIVE_ENDPOINTS}")
ret=$(etcdctl "${extra_flags[@]}" member list | grep -w "$ETCD_INITIAL_ADVERTISE_PEER_URLS" | awk -F "," '{ print $1}')
ret=$(etcdctl "${extra_flags[@]}" member list | grep -w "$ETCD_INITIAL_ADVERTISE_PEER_URLS" | awk -F "," '{ print $1 }')
# if not return zero
info "member id: $ret"
if [[ $? -ne 0 ]]; then
if is_empty_value "$ret"; then
info "No member id found"
echo ""
else
info "member id: $ret"
echo "$ret"
fi
}
}

View File

@ -45,7 +45,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.5`, `3.5-debian-11`, `3.5.4`, `3.5.4-debian-11-r6`, `latest` (3.5/debian-11/Dockerfile)](https://github.com/bitnami/bitnami-docker-etcd/blob/3.5.4-debian-11-r6/3.5/debian-11/Dockerfile)
* [`3.5`, `3.5-debian-11`, `3.5.4`, `3.5.4-debian-11-r7`, `latest` (3.5/debian-11/Dockerfile)](https://github.com/bitnami/bitnami-docker-etcd/blob/3.5.4-debian-11-r7/3.5/debian-11/Dockerfile)
* [`3.4`, `3.4-debian-11`, `3.4.18`, `3.4.18-debian-11-r8` (3.4/debian-11/Dockerfile)](https://github.com/bitnami/bitnami-docker-etcd/blob/3.4.18-debian-11-r8/3.4/debian-11/Dockerfile)
* [`3.3`, `3.3-debian-11`, `3.3.27`, `3.3.27-debian-11-r8` (3.3/debian-11/Dockerfile)](https://github.com/bitnami/bitnami-docker-etcd/blob/3.3.27-debian-11-r8/3.3/debian-11/Dockerfile)