From fb949271bb07642890471cdc4066245021f3c3a7 Mon Sep 17 00:00:00 2001 From: Xuhui zhang Date: Fri, 29 Nov 2024 14:52:39 +0800 Subject: [PATCH] fix exec format command Signed-off-by: Xuhui zhang --- pkg/juicefs/juicefs.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/juicefs/juicefs.go b/pkg/juicefs/juicefs.go index f42cd925d3..8cff562b20 100644 --- a/pkg/juicefs/juicefs.go +++ b/pkg/juicefs/juicefs.go @@ -939,7 +939,9 @@ func (j *juicefs) ceFormat(ctx context.Context, secrets map[string]string, noUpd cmdCtx, cmdCancel := context.WithTimeout(ctx, 8*defaultCheckTimeout) defer cmdCancel() - formatCmd := j.Exec.CommandContext(cmdCtx, config.CeCliPath, args...) + + shArgs := append([]string{config.CeCliPath}, args...) + formatCmd := j.Exec.CommandContext(cmdCtx, "/bin/bash", "-c", strings.Join(shArgs, " ")) envs := syscall.Environ() for key, val := range setting.Envs { envs = append(envs, fmt.Sprintf("%s=%s", security.EscapeBashStr(key), security.EscapeBashStr(val)))