mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-10-16 19:07:45 +00:00
The way docker works is if a user specifies a non `-e Name=Value`, IE just a `-e Name`, then the environment variable Name from the clients OS.ENV is used. Also by default Docker containers run with the HOSTNAME environment set to the HOSTNAME specified for the container. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #21 Approved by: baude
28 lines
763 B
Go
28 lines
763 B
Go
package main
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"github.com/pkg/errors"
|
|
)
|
|
|
|
func getAllLabels(labelFile, inputLabels []string) (map[string]string, error) {
|
|
labels := make(map[string]string)
|
|
labelErr := readKVStrings(labels, labelFile, inputLabels)
|
|
if labelErr != nil {
|
|
return labels, errors.Wrapf(labelErr, "unable to process labels from --label and label-file")
|
|
}
|
|
return labels, nil
|
|
}
|
|
|
|
func convertStringSliceToMap(strSlice []string, delimiter string) (map[string]string, error) {
|
|
sysctl := make(map[string]string)
|
|
for _, inputSysctl := range strSlice {
|
|
values := strings.Split(inputSysctl, delimiter)
|
|
if len(values) < 2 {
|
|
return sysctl, errors.Errorf("%s in an invalid sysctl value", inputSysctl)
|
|
}
|
|
sysctl[values[0]] = values[1]
|
|
}
|
|
return sysctl, nil
|
|
}
|