From d20f3a51463ce75d139dd830e19a173906b0b0cb Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Thu, 16 Aug 2018 06:41:15 -0400 Subject: switch projectatomic to containers Need to get some small changes into libpod to pull back into buildah to complete buildah transition. Signed-off-by: Daniel J Walsh Closes: #1270 Approved by: mheon --- vendor/github.com/projectatomic/buildah/config.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'vendor/github.com/projectatomic/buildah/config.go') diff --git a/vendor/github.com/projectatomic/buildah/config.go b/vendor/github.com/projectatomic/buildah/config.go index b39d2b6c6..731e3b80a 100644 --- a/vendor/github.com/projectatomic/buildah/config.go +++ b/vendor/github.com/projectatomic/buildah/config.go @@ -3,6 +3,7 @@ package buildah import ( "context" "encoding/json" + "os" "path/filepath" "runtime" "strings" @@ -260,11 +261,21 @@ func (b *Builder) Env() []string { // built using an image built from this container. func (b *Builder) SetEnv(k string, v string) { reset := func(s *[]string) { + getenv := func(name string) string { + for i := range *s { + val := strings.SplitN((*s)[i], "=", 2) + if len(val) == 2 && val[0] == name { + return val[1] + } + } + return name + } n := []string{} for i := range *s { if !strings.HasPrefix((*s)[i], k+"=") { n = append(n, (*s)[i]) } + v = os.Expand(v, getenv) } n = append(n, k+"="+v) *s = n -- cgit v1.2.3-54-g00ecf