mirror of
https://github.com/bitnami/containers.git
synced 2026-10-18 19:10:59 +02:00
[bitnami/etcd] Only recalculate the initial cluster config if not provided (#30058)
Only recalculate the initial cluster config if not provided Signed-off-by: Brad Klein <bklein@cray.com> Co-authored-by: Brad Klein <bklein@cray.com>
This commit is contained in:
@@ -617,9 +617,17 @@ etcd_initialize() {
|
||||
info "Restoring snapshot before initializing etcd cluster"
|
||||
local -a restore_args=("--data-dir" "$ETCD_DATA_DIR")
|
||||
if [[ ${#initial_members[@]} -gt 1 ]]; then
|
||||
ETCD_INITIAL_CLUSTER="$(recalculate_initial_cluster)"
|
||||
export ETCD_INITIAL_CLUSTER
|
||||
#
|
||||
# Only recalculate the initial cluster config if it hasn't
|
||||
# been provided.
|
||||
#
|
||||
if is_empty_value "$ETCD_INITIAL_CLUSTER"; then
|
||||
ETCD_INITIAL_CLUSTER="$(recalculate_initial_cluster)"
|
||||
export ETCD_INITIAL_CLUSTER
|
||||
fi
|
||||
|
||||
[[ -f "$ETCD_CONF_FILE" ]] && etcd_conf_write "initial-cluster" "$ETCD_INITIAL_CLUSTER"
|
||||
|
||||
restore_args+=(
|
||||
"--name" "$ETCD_NAME"
|
||||
"--initial-cluster" "$ETCD_INITIAL_CLUSTER"
|
||||
@@ -665,8 +673,14 @@ etcd_initialize() {
|
||||
if [[ "${latest_snapshot_file}" != "" ]]; then
|
||||
info "Restoring etcd cluster from snapshot"
|
||||
rm -rf "$ETCD_DATA_DIR"
|
||||
ETCD_INITIAL_CLUSTER="$(recalculate_initial_cluster)"
|
||||
export ETCD_INITIAL_CLUSTER
|
||||
#
|
||||
# Only recalculate the initial cluster config if it hasn't
|
||||
# been provided.
|
||||
#
|
||||
if is_empty_value "$ETCD_INITIAL_CLUSTER"; then
|
||||
ETCD_INITIAL_CLUSTER="$(recalculate_initial_cluster)"
|
||||
export ETCD_INITIAL_CLUSTER
|
||||
fi
|
||||
[[ -f "$ETCD_CONF_FILE" ]] && etcd_conf_write "initial-cluster" "$ETCD_INITIAL_CLUSTER"
|
||||
debug_execute etcdctl snapshot restore "${latest_snapshot_file}" \
|
||||
--name "$ETCD_NAME" \
|
||||
|
||||
@@ -617,9 +617,17 @@ etcd_initialize() {
|
||||
info "Restoring snapshot before initializing etcd cluster"
|
||||
local -a restore_args=("--data-dir" "$ETCD_DATA_DIR")
|
||||
if [[ ${#initial_members[@]} -gt 1 ]]; then
|
||||
ETCD_INITIAL_CLUSTER="$(recalculate_initial_cluster)"
|
||||
export ETCD_INITIAL_CLUSTER
|
||||
#
|
||||
# Only recalculate the initial cluster config if it hasn't
|
||||
# been provided.
|
||||
#
|
||||
if is_empty_value "$ETCD_INITIAL_CLUSTER"; then
|
||||
ETCD_INITIAL_CLUSTER="$(recalculate_initial_cluster)"
|
||||
export ETCD_INITIAL_CLUSTER
|
||||
fi
|
||||
|
||||
[[ -f "$ETCD_CONF_FILE" ]] && etcd_conf_write "initial-cluster" "$ETCD_INITIAL_CLUSTER"
|
||||
|
||||
restore_args+=(
|
||||
"--name" "$ETCD_NAME"
|
||||
"--initial-cluster" "$ETCD_INITIAL_CLUSTER"
|
||||
@@ -665,8 +673,14 @@ etcd_initialize() {
|
||||
if [[ "${latest_snapshot_file}" != "" ]]; then
|
||||
info "Restoring etcd cluster from snapshot"
|
||||
rm -rf "$ETCD_DATA_DIR"
|
||||
ETCD_INITIAL_CLUSTER="$(recalculate_initial_cluster)"
|
||||
export ETCD_INITIAL_CLUSTER
|
||||
#
|
||||
# Only recalculate the initial cluster config if it hasn't
|
||||
# been provided.
|
||||
#
|
||||
if is_empty_value "$ETCD_INITIAL_CLUSTER"; then
|
||||
ETCD_INITIAL_CLUSTER="$(recalculate_initial_cluster)"
|
||||
export ETCD_INITIAL_CLUSTER
|
||||
fi
|
||||
[[ -f "$ETCD_CONF_FILE" ]] && etcd_conf_write "initial-cluster" "$ETCD_INITIAL_CLUSTER"
|
||||
debug_execute etcdctl snapshot restore "${latest_snapshot_file}" \
|
||||
--name "$ETCD_NAME" \
|
||||
|
||||
@@ -617,9 +617,17 @@ etcd_initialize() {
|
||||
info "Restoring snapshot before initializing etcd cluster"
|
||||
local -a restore_args=("--data-dir" "$ETCD_DATA_DIR")
|
||||
if [[ ${#initial_members[@]} -gt 1 ]]; then
|
||||
ETCD_INITIAL_CLUSTER="$(recalculate_initial_cluster)"
|
||||
export ETCD_INITIAL_CLUSTER
|
||||
#
|
||||
# Only recalculate the initial cluster config if it hasn't
|
||||
# been provided.
|
||||
#
|
||||
if is_empty_value "$ETCD_INITIAL_CLUSTER"; then
|
||||
ETCD_INITIAL_CLUSTER="$(recalculate_initial_cluster)"
|
||||
export ETCD_INITIAL_CLUSTER
|
||||
fi
|
||||
|
||||
[[ -f "$ETCD_CONF_FILE" ]] && etcd_conf_write "initial-cluster" "$ETCD_INITIAL_CLUSTER"
|
||||
|
||||
restore_args+=(
|
||||
"--name" "$ETCD_NAME"
|
||||
"--initial-cluster" "$ETCD_INITIAL_CLUSTER"
|
||||
@@ -665,8 +673,14 @@ etcd_initialize() {
|
||||
if [[ "${latest_snapshot_file}" != "" ]]; then
|
||||
info "Restoring etcd cluster from snapshot"
|
||||
rm -rf "$ETCD_DATA_DIR"
|
||||
ETCD_INITIAL_CLUSTER="$(recalculate_initial_cluster)"
|
||||
export ETCD_INITIAL_CLUSTER
|
||||
#
|
||||
# Only recalculate the initial cluster config if it hasn't
|
||||
# been provided.
|
||||
#
|
||||
if is_empty_value "$ETCD_INITIAL_CLUSTER"; then
|
||||
ETCD_INITIAL_CLUSTER="$(recalculate_initial_cluster)"
|
||||
export ETCD_INITIAL_CLUSTER
|
||||
fi
|
||||
[[ -f "$ETCD_CONF_FILE" ]] && etcd_conf_write "initial-cluster" "$ETCD_INITIAL_CLUSTER"
|
||||
debug_execute etcdctl snapshot restore "${latest_snapshot_file}" \
|
||||
--name "$ETCD_NAME" \
|
||||
|
||||
Reference in New Issue
Block a user