Remove plugins packages from external API.

This commit is contained in:
Jeffrey Regan
2019-11-06 16:07:07 -08:00
committed by jregan
parent ab17d8dd74
commit 300383959d
27 changed files with 447 additions and 21 deletions

View File

@@ -4,6 +4,7 @@
package compiler
import (
"bytes"
"fmt"
"os"
"os/exec"
@@ -12,6 +13,7 @@ import (
"strings"
"time"
"github.com/pkg/errors"
"sigs.k8s.io/kustomize/api/filesys"
"sigs.k8s.io/kustomize/api/konfig"
)
@@ -118,10 +120,12 @@ func (b *Compiler) Compile(g, v, k string) error {
"cannot find go compiler %s", goBin)
}
cmd := exec.Command(goBin, commands...)
var stderr bytes.Buffer
cmd.Stderr = &stderr
cmd.Env = os.Environ()
if err := cmd.Run(); err != nil {
return fmt.Errorf(
"compiler error building %s: %v", srcFile, err)
return errors.Wrapf(
err, "cannot compile %s:\nSTDERR\n%s\n", srcFile, stderr.String())
}
return nil
}