Fix unset env bug for v3 compose

This commit is contained in:
Hang Yan
2018-02-08 15:12:16 +08:00
parent ed9246d537
commit 0ef015d3da
4 changed files with 114 additions and 1 deletions
+8
View File
@@ -0,0 +1,8 @@
version: '3'
services:
foo:
image: foo/bar:latest
environment:
- BAR
- V3_HOST_ENV_TEST_SET_TO_BAR
- FOO=foo
+86
View File
@@ -0,0 +1,86 @@
{
"kind": "List",
"apiVersion": "v1",
"metadata": {},
"items": [
{
"kind": "Service",
"apiVersion": "v1",
"metadata": {
"name": "foo",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "foo"
},
"annotations": {
"kompose.cmd": "%CMD%",
"kompose.version": "%VERSION%"
}
},
"spec": {
"ports": [
{
"name": "headless",
"port": 55555,
"targetPort": 0
}
],
"selector": {
"io.kompose.service": "foo"
},
"clusterIP": "None"
},
"status": {
"loadBalancer": {}
}
},
{
"kind": "Deployment",
"apiVersion": "extensions/v1beta1",
"metadata": {
"name": "foo",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "foo"
},
"annotations": {
"kompose.cmd": "%CMD%",
"kompose.version": "%VERSION%"
}
},
"spec": {
"replicas": 1,
"template": {
"metadata": {
"creationTimestamp": null,
"labels": {
"io.kompose.service": "foo"
}
},
"spec": {
"containers": [
{
"name": "foo",
"image": "foo/bar:latest",
"env": [
{
"name": "V3_HOST_ENV_TEST_SET_TO_BAR",
"value": "BAR"
},
{
"name": "FOO",
"value": "foo"
}
],
"resources": {}
}
],
"restartPolicy": "Always"
}
},
"strategy": {}
},
"status": {}
}
]
}