Skip to content

Commit

Permalink
bugfix: redirect output to file error (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
fengluodb authored Apr 24, 2024
1 parent 70e1e9c commit 2ff42f3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/controller/pgbench_job.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func NewPgbenchRunJobs(cr *v1alpha1.Pgbench) []*batchv1.Job {
Image: constants.GetBenchmarkImage(constants.KubebenchEnvPgbench),
ImagePullPolicy: corev1.PullIfNotPresent,
Command: []string{"/bin/sh", "-c"},
Args: []string{fmt.Sprintf("%s | tee /var/log/pgbench.log", curCmd)},
Args: []string{fmt.Sprintf("%s 2>&1 | tee -a /var/log/pgbench.log", curCmd)},
Env: []corev1.EnvVar{
{
Name: "PGHOST",
Expand Down
2 changes: 1 addition & 1 deletion internal/controller/sysbench_job.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func NewSysbenchCleanupJobs(cr *v1alpha1.Sysbench) []*batchv1.Job {
Image: constants.GetBenchmarkImage(constants.KubebenchEnvSysbench),
ImagePullPolicy: corev1.PullIfNotPresent,
Command: []string{"/bin/sh", "-c"},
Args: []string{"python3 -u infratest.py -t \"$TYPE\" -f \"${FLAG}\" -c \"${CONFIGS}\" -j \"${JSONS}\" | tee /var/log/sysbench.log"},
Args: []string{"python3 -u infratest.py -t \"$TYPE\" -f \"${FLAG}\" -c \"${CONFIGS}\" -j \"${JSONS}\" 2>&1 | tee -a /var/log/sysbench.log"},
Env: []corev1.EnvVar{
{
Name: "TYPE",
Expand Down

0 comments on commit 2ff42f3

Please sign in to comment.