utils_windows.go 443 B

123456789101112131415
  1. package local // import "github.com/docker/docker/libcontainerd/local"
  2. import "strings"
  3. // setupEnvironmentVariables converts a string array of environment variables
  4. // into a map as required by the HCS. Source array is in format [v1=k1] [v2=k2] etc.
  5. func setupEnvironmentVariables(a []string) map[string]string {
  6. r := make(map[string]string)
  7. for _, s := range a {
  8. if k, v, ok := strings.Cut(s, "="); ok {
  9. r[k] = v
  10. }
  11. }
  12. return r
  13. }