mirror of
https://github.com/kubevela/kubevela.git
synced 2026-02-14 10:00:06 +00:00
fix: dangerous-exec-command-87 (#6999)
Some checks failed
Webhook Upgrade Validation / webhook-upgrade-check (push) Failing after 17m1s
Some checks failed
Webhook Upgrade Validation / webhook-upgrade-check (push) Failing after 17m1s
Co-authored-by: root <root@ai-guardian-remediation-54f45fdc58-g5zpm>
This commit is contained in:
@@ -17,6 +17,7 @@ limitations under the License.
|
||||
package e2e
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path"
|
||||
@@ -83,6 +84,9 @@ func asyncExec(cli string) (*gexec.Session, error) {
|
||||
func LongTimeExecWithEnv(cli string, timeout time.Duration, env []string) (string, error) {
|
||||
var output []byte
|
||||
c := strings.Fields(cli)
|
||||
if len(c) == 0 {
|
||||
return "", fmt.Errorf("empty command")
|
||||
}
|
||||
commandName := path.Join(rudrPath, c[0])
|
||||
command := exec.Command(commandName, c[1:]...)
|
||||
command.Env = os.Environ()
|
||||
|
||||
Reference in New Issue
Block a user