Bump github.com/containers/buildah from 1.16.4 to 1.16.5

Bumps [github.com/containers/buildah](https://github.com/containers/buildah) from 1.16.4 to 1.16.5.
- [Release notes](https://github.com/containers/buildah/releases)
- [Changelog](https://github.com/containers/buildah/blob/master/CHANGELOG.md)
- [Commits](https://github.com/containers/buildah/compare/v1.16.4...v1.16.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
dependabot-preview[bot]
2020-10-23 08:18:13 +00:00
committed by Daniel J Walsh
parent 2adc1b284d
commit 22b1d10d31
19 changed files with 152 additions and 107 deletions

View File

@ -93,27 +93,28 @@ func parseOptInterval(f *flag.Flag) (time.Duration, error) {
return d, nil
}
// makeUserArgs - Package the variables from the Dockerfile defined by
// the ENV aand the ARG statements into one slice so the values
// defined by both can later be evaluated when resolving variables
// such as ${MY_USER}. If the variable is defined by both ARG and ENV
// don't include the definition of the ARG variable.
func makeUserArgs(bEnv []string, bArgs map[string]string) (userArgs []string) {
userArgs = bEnv
envMap := make(map[string]string)
for _, envVal := range bEnv {
val := strings.SplitN(envVal, "=", 2)
if len(val) > 1 {
envMap[val[0]] = val[1]
}
}
for key, value := range bArgs {
if _, ok := envMap[key]; ok {
// mergeEnv merges two lists of environment variables, avoiding duplicates.
func mergeEnv(defaults, overrides []string) []string {
s := make([]string, 0, len(defaults)+len(overrides))
index := make(map[string]int)
for _, envSpec := range append(defaults, overrides...) {
envVar := strings.SplitN(envSpec, "=", 2)
if i, ok := index[envVar[0]]; ok {
s[i] = envSpec
continue
}
userArgs = append(userArgs, key+"="+value)
s = append(s, envSpec)
index[envVar[0]] = len(s) - 1
}
return userArgs
return s
}
// envMapAsSlice returns the contents of a map[string]string as a slice of keys
// and values joined with "=".
func envMapAsSlice(m map[string]string) []string {
s := make([]string, 0, len(m))
for k, v := range m {
s = append(s, k+"="+v)
}
return s
}