mirror of https://github.com/kubernetes/kops.git
Merge pull request #4082 from justinsb/unattended_apt_get
Automatic merge from submit-queue. apt-get: specify unattended installation
This commit is contained in:
commit
f0303c80dc
|
@ -296,9 +296,10 @@ func (_ *Package) RenderLocal(t *local.LocalTarget, a, e, changes *Package) erro
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
var args []string
|
var args []string
|
||||||
|
env := os.Environ()
|
||||||
if t.HasTag(tags.TagOSFamilyDebian) {
|
if t.HasTag(tags.TagOSFamilyDebian) {
|
||||||
args = []string{"apt-get", "install", "--yes", e.Name}
|
args = []string{"apt-get", "install", "--yes", e.Name}
|
||||||
|
env = append(env, "DEBIAN_FRONTEND=noninteractive")
|
||||||
} else if t.HasTag(tags.TagOSFamilyRHEL) {
|
} else if t.HasTag(tags.TagOSFamilyRHEL) {
|
||||||
args = []string{"/usr/bin/yum", "install", "-y", e.Name}
|
args = []string{"/usr/bin/yum", "install", "-y", e.Name}
|
||||||
} else {
|
} else {
|
||||||
|
@ -307,6 +308,7 @@ func (_ *Package) RenderLocal(t *local.LocalTarget, a, e, changes *Package) erro
|
||||||
|
|
||||||
glog.Infof("running command %s", args)
|
glog.Infof("running command %s", args)
|
||||||
cmd := exec.Command(args[0], args[1:]...)
|
cmd := exec.Command(args[0], args[1:]...)
|
||||||
|
cmd.Env = env
|
||||||
output, err := cmd.CombinedOutput()
|
output, err := cmd.CombinedOutput()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error installing package %q: %v: %s", e.Name, err, string(output))
|
return fmt.Errorf("error installing package %q: %v: %s", e.Name, err, string(output))
|
||||||
|
|
Loading…
Reference in New Issue