mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-05 12:57:42 +00:00
feat(internode): harden p0 transport boundary and baseline tooling (#3017)
* feat(internode): p0 transport baseline and ci hardening * fix(internode): avoid double wrapping transport errors --------- Co-authored-by: Henry Guo <marshawcoco@users.noreply.github.com> Co-authored-by: houseme <housemecn@gmail.com>
This commit is contained in:
@@ -78,6 +78,34 @@ require_cmd() {
|
||||
fi
|
||||
}
|
||||
|
||||
print_dry_run_command() {
|
||||
local redact_next=false
|
||||
local arg
|
||||
|
||||
printf '[DRY-RUN]'
|
||||
for arg in "$@"; do
|
||||
if [[ "${redact_next}" == "true" ]]; then
|
||||
printf ' %q' "REDACTED"
|
||||
redact_next=false
|
||||
continue
|
||||
fi
|
||||
|
||||
case "${arg}" in
|
||||
--access-key|--secret-key)
|
||||
printf ' %q' "${arg}"
|
||||
redact_next=true
|
||||
;;
|
||||
-accessKey=*|-secretKey=*)
|
||||
printf ' %q' "${arg%%=*}=REDACTED"
|
||||
;;
|
||||
*)
|
||||
printf ' %q' "${arg}"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
printf '\n'
|
||||
}
|
||||
|
||||
normalize_warp_host() {
|
||||
local raw="$1"
|
||||
raw="${raw#http://}"
|
||||
@@ -215,8 +243,7 @@ run_one() {
|
||||
fi
|
||||
|
||||
if [[ "$DRY_RUN" == "true" ]]; then
|
||||
printf '[DRY-RUN] %q ' "${cmd[@]}"
|
||||
printf '\n'
|
||||
print_dry_run_command "${cmd[@]}"
|
||||
echo "size=$size tool=$TOOL dry_run" > "$log_file"
|
||||
else
|
||||
if ! "${cmd[@]}" 2>&1 | tee "$log_file"; then
|
||||
@@ -243,8 +270,7 @@ run_one() {
|
||||
fi
|
||||
|
||||
if [[ "$DRY_RUN" == "true" ]]; then
|
||||
printf '[DRY-RUN] %q ' "${cmd[@]}"
|
||||
printf '\n'
|
||||
print_dry_run_command "${cmd[@]}"
|
||||
echo "size=$size tool=$TOOL dry_run" > "$log_file"
|
||||
else
|
||||
if ! "${cmd[@]}" 2>&1 | tee "$log_file"; then
|
||||
@@ -275,10 +301,12 @@ main() {
|
||||
validate_args
|
||||
resolve_bucket
|
||||
require_cmd rg
|
||||
if [[ "$TOOL" == "warp" ]]; then
|
||||
require_cmd "$WARP_BIN"
|
||||
else
|
||||
require_cmd "$S3BENCH_BIN"
|
||||
if [[ "$DRY_RUN" != "true" ]]; then
|
||||
if [[ "$TOOL" == "warp" ]]; then
|
||||
require_cmd "$WARP_BIN"
|
||||
else
|
||||
require_cmd "$S3BENCH_BIN"
|
||||
fi
|
||||
fi
|
||||
|
||||
setup_output
|
||||
|
||||
Reference in New Issue
Block a user