diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2018-08-16 06:41:15 -0400 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-08-16 17:12:36 +0000 |
commit | d20f3a51463ce75d139dd830e19a173906b0b0cb (patch) | |
tree | c4cb4fe0d68ac052149031c590823b033a92fa80 /vendor/github.com/projectatomic/buildah/config.go | |
parent | c0abfaa7c38a8fc897a4c1f64392ace40a5a10c1 (diff) | |
download | podman-d20f3a51463ce75d139dd830e19a173906b0b0cb.tar.gz podman-d20f3a51463ce75d139dd830e19a173906b0b0cb.tar.bz2 podman-d20f3a51463ce75d139dd830e19a173906b0b0cb.zip |
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 <dwalsh@redhat.com>
Closes: #1270
Approved by: mheon
Diffstat (limited to 'vendor/github.com/projectatomic/buildah/config.go')
-rw-r--r-- | vendor/github.com/projectatomic/buildah/config.go | 11 |
1 files changed, 11 insertions, 0 deletions
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 |