support for raw pod output

if a user specifies a docker-compose service
with restart value as "no" or "on-failure"
then normal pod will be created as against
to a controller and a pod.
This commit is contained in:
Suraj Deshmukh
2016-12-13 19:24:25 +05:30
parent 65e19e3105
commit 6ea5f72e40
12 changed files with 288 additions and 17 deletions
+10
View File
@@ -103,4 +103,14 @@ convert::expect_success "kompose --bundle $KOMPOSE_ROOT/script/test/fixtures/bun
# Test related to kompose --bundle convert to ensure that DSB bundles are converted properly
convert::expect_success_and_warning "kompose --bundle $KOMPOSE_ROOT/script/test/fixtures/bundles/dsb/docker-voting-bundle.dsb convert --stdout" "$KOMPOSE_ROOT/script/test/fixtures/bundles/dsb/output-k8s.json" "Service cannot be created because of missing port."
######
# Test related to restart options in docker-compose
# kubernetes test
convert::expect_success "kompose -f $KOMPOSE_ROOT/script/test/fixtures/restart-options/docker-compose-restart-no.yml convert --stdout" "$KOMPOSE_ROOT/script/test/fixtures/restart-options/output-k8s-restart-no.json"
convert::expect_success "kompose -f $KOMPOSE_ROOT/script/test/fixtures/restart-options/docker-compose-restart-onfail.yml convert --stdout" "$KOMPOSE_ROOT/script/test/fixtures/restart-options/output-k8s-restart-onfail.json"
# openshift test
convert::expect_success "kompose -f $KOMPOSE_ROOT/script/test/fixtures/restart-options/docker-compose-restart-no.yml --provider openshift convert --stdout" "$KOMPOSE_ROOT/script/test/fixtures/restart-options/output-os-restart-no.json"
convert::expect_success "kompose -f $KOMPOSE_ROOT/script/test/fixtures/restart-options/docker-compose-restart-onfail.yml --provider openshift convert --stdout" "$KOMPOSE_ROOT/script/test/fixtures/restart-options/output-os-restart-onfail.json"
exit $EXIT_STATUS
@@ -0,0 +1,9 @@
version: "2"
services:
foo:
image: "foobar"
restart: "no"
environment:
GITHUB: surajssd
@@ -0,0 +1,9 @@
version: "2"
services:
foo:
image: "foobar"
restart: "on-failure"
environment:
GITHUB: surajssd
@@ -0,0 +1,35 @@
{
"kind": "List",
"apiVersion": "v1",
"metadata": {},
"items": [
{
"kind": "Pod",
"apiVersion": "v1",
"metadata": {
"name": "foo",
"creationTimestamp": null,
"labels": {
"service": "foo"
}
},
"spec": {
"containers": [
{
"name": "foo",
"image": "foobar",
"env": [
{
"name": "GITHUB",
"value": "surajssd"
}
],
"resources": {}
}
],
"restartPolicy": "Never"
},
"status": {}
}
]
}
@@ -0,0 +1,35 @@
{
"kind": "List",
"apiVersion": "v1",
"metadata": {},
"items": [
{
"kind": "Pod",
"apiVersion": "v1",
"metadata": {
"name": "foo",
"creationTimestamp": null,
"labels": {
"service": "foo"
}
},
"spec": {
"containers": [
{
"name": "foo",
"image": "foobar",
"env": [
{
"name": "GITHUB",
"value": "surajssd"
}
],
"resources": {}
}
],
"restartPolicy": "OnFailure"
},
"status": {}
}
]
}
@@ -0,0 +1,35 @@
{
"kind": "List",
"apiVersion": "v1",
"metadata": {},
"items": [
{
"kind": "Pod",
"apiVersion": "v1",
"metadata": {
"name": "foo",
"creationTimestamp": null,
"labels": {
"service": "foo"
}
},
"spec": {
"containers": [
{
"name": "foo",
"image": "foobar",
"env": [
{
"name": "GITHUB",
"value": "surajssd"
}
],
"resources": {}
}
],
"restartPolicy": "Never"
},
"status": {}
}
]
}
@@ -0,0 +1,35 @@
{
"kind": "List",
"apiVersion": "v1",
"metadata": {},
"items": [
{
"kind": "Pod",
"apiVersion": "v1",
"metadata": {
"name": "foo",
"creationTimestamp": null,
"labels": {
"service": "foo"
}
},
"spec": {
"containers": [
{
"name": "foo",
"image": "foobar",
"env": [
{
"name": "GITHUB",
"value": "surajssd"
}
],
"resources": {}
}
],
"restartPolicy": "OnFailure"
},
"status": {}
}
]
}