Skip to content

Commit

Permalink
[bitnami/etcd] fix: healthcheck will failed when startup etcd with on… (
Browse files Browse the repository at this point in the history
#70597)

[bitnami/etcd] fix: healthcheck will failed when startup etcd with one-way tls authentication (#70554)

Signed-off-by: Chen Rao <[email protected]>
  • Loading branch information
chenraoCR authored Sep 23, 2024
1 parent 88cb1d4 commit 1a0f63f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,12 @@ host="$(parse_uri "${advertised_array[0]}" "host")"
port="$(parse_uri "${advertised_array[0]}" "port")"
read -r -a extra_flags <<< "$(etcdctl_auth_flags)"
extra_flags+=("--endpoints=${host}:${port}")
if [[ $ETCD_AUTO_TLS = true ]]; then

# if ETCD_AUTO_TLS true or CA file not exists, just skip server cert verification
if [[ $ETCD_AUTO_TLS = true ]] || [[ ! -f "$ETCD_TRUSTED_CA_FILE" ]]; then
extra_flags+=("--insecure-skip-tls-verify")
fi

if etcdctl endpoint health "${extra_flags[@]}"; then
exit 0
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,12 @@ host="$(parse_uri "${advertised_array[0]}" "host")"
port="$(parse_uri "${advertised_array[0]}" "port")"
read -r -a extra_flags <<< "$(etcdctl_auth_flags)"
extra_flags+=("--endpoints=${host}:${port}")
if [[ $ETCD_AUTO_TLS = true ]]; then

# if ETCD_AUTO_TLS true or CA file not exists, just skip server cert verification
if [[ $ETCD_AUTO_TLS = true ]] || [[ ! -f "$ETCD_TRUSTED_CA_FILE" ]]; then
extra_flags+=("--insecure-skip-tls-verify")
fi

if etcdctl endpoint health "${extra_flags[@]}"; then
exit 0
else
Expand Down

0 comments on commit 1a0f63f

Please sign in to comment.