Fix issue where environment variables with embedded equals signs were
being dropped and not passed to the container.
Fixes #26178.
Signed-off-by: Matt Richardson <matt.richardson@octopus.com>
17 | 17 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,13 @@ |
0 |
+package libcontainerd |
|
1 |
+ |
|
2 |
+import ( |
|
3 |
+ "testing" |
|
4 |
+) |
|
5 |
+ |
|
6 |
+func TestEnvironmentParsing(t *testing.T) { |
|
7 |
+ env := []string{"foo=bar", "car=hat", "a=b=c"} |
|
8 |
+ result := setupEnvironmentVariables(env) |
|
9 |
+ if len(result) != 3 || result["foo"] != "bar" || result["car"] != "hat" || result["a"] != "b=c" { |
|
10 |
+ t.Fatalf("Expected map[foo:bar car:hat a:b=c], got %v", result) |
|
11 |
+ } |
|
12 |
+} |