feat(api): bind extensions stdout and stderr to current process (#3375)

pull/3392/head
Anthony Lapenna 2019-11-20 14:08:16 +13:00 committed by GitHub
parent b8be795505
commit 1f90a091a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -5,6 +5,7 @@ import (
"encoding/json"
"errors"
"log"
"os"
"os/exec"
"path"
"runtime"
@ -195,7 +196,7 @@ func validateLicense(binaryPath, licenseKey string) ([]string, error) {
err := licenseCheckProcess.Run()
if err != nil {
log.Printf("[DEBUG] [exec,extension] [message: unable to run extension process] [err: %s]", err)
return nil, errors.New("Invalid extension license key")
return nil, errors.New("invalid extension license key")
}
output := string(cmdOutput.Bytes())
@ -205,6 +206,9 @@ func validateLicense(binaryPath, licenseKey string) ([]string, error) {
func (manager *ExtensionManager) startExtensionProcess(extension *portainer.Extension, binaryPath string) error {
extensionProcess := exec.Command(binaryPath, "-license", extension.License.LicenseKey)
extensionProcess.Stdout = os.Stdout
extensionProcess.Stderr = os.Stderr
err := extensionProcess.Start()
if err != nil {
return err