Skip to content

Commit ed77213

Browse files
authored
fix: add inline shell comment for sh -c wrapping (#167)
1 parent 80538c5 commit ed77213

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

internal/webhook/v1/pod_webhook.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,8 @@ func (m *TensorFusionPodMutator) patchTFClient(
259259
shell := container.Command[0]
260260
if (shell == "bash" || shell == "zsh") && container.Command[1] == "-c" {
261261
originalCommand := container.Command[2]
262-
safeCommand := shellescape.Quote(originalCommand)
262+
comment := "# [TensorFusion Patch] This command is wrapped by sh -c to improve compatibility with certain container environments."
263+
safeCommand := shellescape.Quote(fmt.Sprintf("%s\n%s", comment, originalCommand))
263264
container.Command = []string{"sh", "-c", fmt.Sprintf("%s -c %s", shell, safeCommand)}
264265
}
265266
}

0 commit comments

Comments
 (0)