etcdserver: intentionally set the memberID as 0 in corruption alarm

Signed-off-by: Benjamin Wang <wachao@vmware.com>
This commit is contained in:
Benjamin Wang
2022-11-25 15:43:44 +08:00
parent cecbe35ce0
commit ba122c9d56
5 changed files with 25 additions and 21 deletions

View File

@@ -71,7 +71,8 @@ function relativePath {
local commonPart=$source
local result=""
while [[ "${target#$commonPart}" == "${target}" ]]; do
# Refer to https://www.shellcheck.net/wiki/SC2295
while [[ "${target#"$commonPart"}" == "${target}" ]]; do
# no match, means that candidate common part is not correct
# go up one level (reduce common part)
commonPart="$(dirname "$commonPart")"
@@ -90,7 +91,8 @@ function relativePath {
# since we now have identified the common part,
# compute the non-common part
local forwardPart="${target#$commonPart}"
# Refer to https://www.shellcheck.net/wiki/SC2295
local forwardPart="${target#"$commonPart"}"
# and now stick all parts together
if [[ -n $result ]] && [[ -n $forwardPart ]]; then