Skip to content

Commit

Permalink
fix exec format command (#1196)
Browse files Browse the repository at this point in the history
Signed-off-by: Xuhui zhang <[email protected]>
  • Loading branch information
zxh326 authored Dec 2, 2024
1 parent 7d7b1cd commit 4e63ca7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/juicefs/juicefs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down

0 comments on commit 4e63ca7

Please sign in to comment.