Skip to content

Commit

Permalink
Use bash -c instead of sh -c
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangpengcheng committed Jan 15, 2024
1 parent 759cbf6 commit fb0feda
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions controllers/spec/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ package spec
import (
"bytes"
"context"

Check failure on line 22 in controllers/spec/common.go

View workflow job for this annotation

GitHub Actions / unit-tests (1.19)

File is not `goimports`-ed (goimports)

Check failure on line 22 in controllers/spec/common.go

View workflow job for this annotation

GitHub Actions / unit-tests (1.20.4)

File is not `goimports`-ed (goimports)
"regexp"

autoscalingv2beta2 "k8s.io/api/autoscaling/v2beta2"

// used for template
_ "embed"
"encoding/json"
Expand All @@ -32,12 +28,14 @@ import (
"html/template"
"os"
"reflect"
"regexp"
"sort"
"strconv"
"strings"

appsv1 "k8s.io/api/apps/v1"
autov2 "k8s.io/api/autoscaling/v2"
autoscalingv2beta2 "k8s.io/api/autoscaling/v2beta2"
v1 "k8s.io/api/batch/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down Expand Up @@ -354,7 +352,7 @@ func MakeJavaFunctionCommand(downloadPath, packageFile, name, clusterName, gener
authProvided, tlsProvided, tlsConfig, authConfig), " ")
processCommand = downloadCommand + " && " + processCommand
}
return []string{"sh", "-c", processCommand}
return []string{"bash", "-c", processCommand}
}

func MakePythonFunctionCommand(downloadPath, packageFile, name, clusterName, generateLogConfigCommand, details, uid string,
Expand All @@ -371,7 +369,7 @@ func MakePythonFunctionCommand(downloadPath, packageFile, name, clusterName, gen
tlsProvided, tlsConfig, authConfig), " ")
processCommand = downloadCommand + " && " + processCommand
}
return []string{"sh", "-c", processCommand}
return []string{"bash", "-c", processCommand}
}

func MakeGoFunctionCommand(downloadPath, goExecFilePath string, function *v1alpha1.Function) []string {
Expand All @@ -390,7 +388,7 @@ func MakeGoFunctionCommand(downloadPath, goExecFilePath string, function *v1alph
function.Spec.Pulsar.TLSSecret != "", function.Spec.Pulsar.TLSConfig, function.Spec.Pulsar.AuthConfig), " ")
processCommand = downloadCommand + " && ls -al && pwd &&" + processCommand
}
return []string{"sh", "-c", processCommand}
return []string{"bash", "-c", processCommand}
}

func MakeGenericFunctionCommand(downloadPath, functionFile, language, clusterName, details, uid string, authProvided, tlsProvided bool, secretMaps map[string]v1alpha1.SecretRef,
Expand Down

0 comments on commit fb0feda

Please sign in to comment.