forked from LaconicNetwork/kompose
add test for key-only env
This commit is contained in:
parent
000ed33cb1
commit
a881f5cca0
@ -103,7 +103,6 @@ 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
|
||||
@ -113,4 +112,10 @@ convert::expect_success "kompose -f $KOMPOSE_ROOT/script/test/fixtures/restart-o
|
||||
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"
|
||||
|
||||
######
|
||||
# Test key-only envrionment variable
|
||||
export $(cat $KOMPOSE_ROOT/script/test/fixtures/keyonly-envs/envs)
|
||||
convert::expect_success "kompose --file $KOMPOSE_ROOT/script/test/fixtures/keyonly-envs/env.yml convert --stdout" "$KOMPOSE_ROOT/script/test/fixtures/keyonly-envs/output-k8s.json"
|
||||
unset $(cat $KOMPOSE_ROOT/script/test/fixtures/keyonly-envs/envs | cut -d'=' -f1)
|
||||
|
||||
exit $EXIT_STATUS
|
||||
|
||||
25
script/test/fixtures/keyonly-envs/env.yml
vendored
Normal file
25
script/test/fixtures/keyonly-envs/env.yml
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
version: "2"
|
||||
|
||||
services:
|
||||
redis-master:
|
||||
image: gcr.io/google_containers/redis:e2e
|
||||
ports:
|
||||
- "6379"
|
||||
redis-slave:
|
||||
image: gcr.io/google_samples/gb-redisslave:v1
|
||||
ports:
|
||||
- "6379"
|
||||
environment:
|
||||
- GET_HOSTS_FROM=dns
|
||||
- RACK_ENV=development
|
||||
- SHOW=true
|
||||
- SESSION_SECRET
|
||||
frontend:
|
||||
image: gcr.io/google-samples/gb-frontend:v4
|
||||
ports:
|
||||
- "80:80"
|
||||
environment:
|
||||
GET_HOSTS_FROM: dns
|
||||
RACK_ENV: development
|
||||
SHOW: 'true'
|
||||
SESSION_SECRET:
|
||||
1
script/test/fixtures/keyonly-envs/envs
vendored
Normal file
1
script/test/fixtures/keyonly-envs/envs
vendored
Normal file
@ -0,0 +1 @@
|
||||
SESSION_SECRET=session
|
||||
235
script/test/fixtures/keyonly-envs/output-k8s.json
vendored
Normal file
235
script/test/fixtures/keyonly-envs/output-k8s.json
vendored
Normal file
@ -0,0 +1,235 @@
|
||||
{
|
||||
"kind": "List",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {},
|
||||
"items": [
|
||||
{
|
||||
"kind": "Service",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "frontend",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"service": "frontend"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"ports": [
|
||||
{
|
||||
"name": "80",
|
||||
"protocol": "TCP",
|
||||
"port": 80,
|
||||
"targetPort": 80
|
||||
}
|
||||
],
|
||||
"selector": {
|
||||
"service": "frontend"
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"loadBalancer": {}
|
||||
}
|
||||
},
|
||||
{
|
||||
"kind": "Service",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "redis-master",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"service": "redis-master"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"ports": [
|
||||
{
|
||||
"name": "6379",
|
||||
"protocol": "TCP",
|
||||
"port": 6379,
|
||||
"targetPort": 6379
|
||||
}
|
||||
],
|
||||
"selector": {
|
||||
"service": "redis-master"
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"loadBalancer": {}
|
||||
}
|
||||
},
|
||||
{
|
||||
"kind": "Service",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "redis-slave",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"service": "redis-slave"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"ports": [
|
||||
{
|
||||
"name": "6379",
|
||||
"protocol": "TCP",
|
||||
"port": 6379,
|
||||
"targetPort": 6379
|
||||
}
|
||||
],
|
||||
"selector": {
|
||||
"service": "redis-slave"
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"loadBalancer": {}
|
||||
}
|
||||
},
|
||||
{
|
||||
"kind": "Deployment",
|
||||
"apiVersion": "extensions/v1beta1",
|
||||
"metadata": {
|
||||
"name": "frontend",
|
||||
"creationTimestamp": null
|
||||
},
|
||||
"spec": {
|
||||
"replicas": 1,
|
||||
"template": {
|
||||
"metadata": {
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"service": "frontend"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"containers": [
|
||||
{
|
||||
"name": "frontend",
|
||||
"image": "gcr.io/google-samples/gb-frontend:v4",
|
||||
"ports": [
|
||||
{
|
||||
"containerPort": 80,
|
||||
"protocol": "TCP"
|
||||
}
|
||||
],
|
||||
"env": [
|
||||
{
|
||||
"name": "GET_HOSTS_FROM",
|
||||
"value": "dns"
|
||||
},
|
||||
{
|
||||
"name": "RACK_ENV",
|
||||
"value": "development"
|
||||
},
|
||||
{
|
||||
"name": "SESSION_SECRET",
|
||||
"value": "session"
|
||||
},
|
||||
{
|
||||
"name": "SHOW",
|
||||
"value": "true"
|
||||
}
|
||||
],
|
||||
"resources": {}
|
||||
}
|
||||
],
|
||||
"restartPolicy": "Always"
|
||||
}
|
||||
},
|
||||
"strategy": {}
|
||||
},
|
||||
"status": {}
|
||||
},
|
||||
{
|
||||
"kind": "Deployment",
|
||||
"apiVersion": "extensions/v1beta1",
|
||||
"metadata": {
|
||||
"name": "redis-master",
|
||||
"creationTimestamp": null
|
||||
},
|
||||
"spec": {
|
||||
"replicas": 1,
|
||||
"template": {
|
||||
"metadata": {
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"service": "redis-master"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"containers": [
|
||||
{
|
||||
"name": "redis-master",
|
||||
"image": "gcr.io/google_containers/redis:e2e",
|
||||
"ports": [
|
||||
{
|
||||
"containerPort": 6379,
|
||||
"protocol": "TCP"
|
||||
}
|
||||
],
|
||||
"resources": {}
|
||||
}
|
||||
],
|
||||
"restartPolicy": "Always"
|
||||
}
|
||||
},
|
||||
"strategy": {}
|
||||
},
|
||||
"status": {}
|
||||
},
|
||||
{
|
||||
"kind": "Deployment",
|
||||
"apiVersion": "extensions/v1beta1",
|
||||
"metadata": {
|
||||
"name": "redis-slave",
|
||||
"creationTimestamp": null
|
||||
},
|
||||
"spec": {
|
||||
"replicas": 1,
|
||||
"template": {
|
||||
"metadata": {
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"service": "redis-slave"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"containers": [
|
||||
{
|
||||
"name": "redis-slave",
|
||||
"image": "gcr.io/google_samples/gb-redisslave:v1",
|
||||
"ports": [
|
||||
{
|
||||
"containerPort": 6379,
|
||||
"protocol": "TCP"
|
||||
}
|
||||
],
|
||||
"env": [
|
||||
{
|
||||
"name": "GET_HOSTS_FROM",
|
||||
"value": "dns"
|
||||
},
|
||||
{
|
||||
"name": "RACK_ENV",
|
||||
"value": "development"
|
||||
},
|
||||
{
|
||||
"name": "SHOW",
|
||||
"value": "true"
|
||||
},
|
||||
{
|
||||
"name": "SESSION_SECRET",
|
||||
"value": "session"
|
||||
}
|
||||
],
|
||||
"resources": {}
|
||||
}
|
||||
],
|
||||
"restartPolicy": "Always"
|
||||
}
|
||||
},
|
||||
"strategy": {}
|
||||
},
|
||||
"status": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user