summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Duvall <dduvall@wikimedia.org>2018-04-27 15:10:08 -0700
committerDan Duvall <dduvall@wikimedia.org>2018-04-30 14:03:33 -0700
commit71f24e2bcaf4191fee021ddaaa1a15b9bf3cb2e4 (patch)
tree2029c4e4b484397d3c20293ede578b719bb37202
parentea364b2f417eee12f3bf22c145b7d8594ad623ef (diff)
downloadblubber-71f24e2bcaf4191fee021ddaaa1a15b9bf3cb2e4.tar.gz
Ensure non-interactive front-end for APT
Summary: Ensure that `DEBIAN_FRONTEND=noninteractive` is set before injecting `apt-get install` instructions. Test Plan: Run unit tests. Reviewers: thcipriani, mmodell, hashar, demon, #release-engineering-team Reviewed By: thcipriani, #release-engineering-team Tags: #release-engineering-team Differential Revision: https://phabricator.wikimedia.org/D1032
-rw-r--r--config/apt.go3
-rw-r--r--config/apt_test.go3
2 files changed, 6 insertions, 0 deletions
diff --git a/config/apt.go b/config/apt.go
index 01f914e..bafc06a 100644
--- a/config/apt.go
+++ b/config/apt.go
@@ -30,6 +30,9 @@ func (apt AptConfig) InstructionsForPhase(phase build.Phase) []build.Instruction
switch phase {
case build.PhasePrivileged:
return []build.Instruction{
+ build.Env{map[string]string{
+ "DEBIAN_FRONTEND": "noninteractive",
+ }},
build.RunAll{[]build.Run{
{"apt-get update", []string{}},
{"apt-get install -y", apt.Packages},
diff --git a/config/apt_test.go b/config/apt_test.go
index 751bfcd..df2480d 100644
--- a/config/apt_test.go
+++ b/config/apt_test.go
@@ -40,6 +40,9 @@ func TestAptConfigInstructions(t *testing.T) {
t.Run("PhasePrivileged", func(t *testing.T) {
assert.Equal(t,
[]build.Instruction{
+ build.Env{map[string]string{
+ "DEBIAN_FRONTEND": "noninteractive",
+ }},
build.RunAll{[]build.Run{
{"apt-get update", []string{}},
{"apt-get install -y", []string{"libfoo", "libbar"}},