summaryrefslogtreecommitdiff
path: root/vendor/github.com/projectatomic/buildah/config.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/projectatomic/buildah/config.go')
-rw-r--r--vendor/github.com/projectatomic/buildah/config.go11
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