Network Key Translation Feature and test cases (#1195)

This commit is contained in:
Mudit Verma
2019-12-01 10:19:23 +08:00
committed by Hang Yan
parent c13d50ee17
commit ac2b852955
18 changed files with 606 additions and 40 deletions
+15
View File
@@ -0,0 +1,15 @@
version: '3'
networks:
app:
external:
name: app-network
web:
external:
name: web-network
services:
appFoo:
image: foo:latest
command: sh -c "echo Hello Foo"
networks:
app: {}
web: {}
+112
View File
@@ -0,0 +1,112 @@
{
"kind": "List",
"apiVersion": "v1",
"metadata": {},
"items": [
{
"kind": "Deployment",
"apiVersion": "extensions/v1beta1",
"metadata": {
"name": "appfoo",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "appfoo"
},
"annotations": {
"kompose.cmd": "%CMD%"
"kompose.version": "%VERSION%"
}
},
"spec": {
"replicas": 1,
"template": {
"metadata": {
"creationTimestamp": null,
"labels": {
"io.kompose.network/app-network": "true",
"io.kompose.network/web-network": "true",
"io.kompose.service": "appfoo"
},
"annotations": {
"kompose.cmd": "%CMD%"
"kompose.version": "%VERSION%"
}
},
"spec": {
"containers": [
{
"name": "appfoo",
"image": "foo:latest",
"args": [
"sh",
"-c",
"echo Hello Foo"
],
"resources": {}
}
],
"restartPolicy": "Always"
}
},
"strategy": {}
},
"status": {}
},
{
"kind": "NetworkPolicy",
"apiVersion": "extensions/v1beta1",
"metadata": {
"name": "app-network",
"creationTimestamp": null
},
"spec": {
"podSelector": {
"matchLabels": {
"io.kompose.network/app-network": "true"
}
},
"ingress": [
{
"from": [
{
"podSelector": {
"matchLabels": {
"io.kompose.network/app-network": "true"
}
}
}
]
}
]
}
},
{
"kind": "NetworkPolicy",
"apiVersion": "extensions/v1beta1",
"metadata": {
"name": "web-network",
"creationTimestamp": null
},
"spec": {
"podSelector": {
"matchLabels": {
"io.kompose.network/web-network": "true"
}
},
"ingress": [
{
"from": [
{
"podSelector": {
"matchLabels": {
"io.kompose.network/web-network": "true"
}
}
}
]
}
]
}
}
]
}
+104
View File
@@ -0,0 +1,104 @@
{
"kind": "List",
"apiVersion": "v1",
"metadata": {},
"items": [
{
"kind": "DeploymentConfig",
"apiVersion": "v1",
"metadata": {
"name": "appfoo",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "appfoo"
},
"annotations": {
"kompose.cmd": "%CMD%"
"kompose.version": "%VERSION%"
}
},
"spec": {
"strategy": {
"resources": {}
},
"triggers": [
{
"type": "ConfigChange"
},
{
"type": "ImageChange",
"imageChangeParams": {
"automatic": true,
"containerNames": [
"appfoo"
],
"from": {
"kind": "ImageStreamTag",
"name": "appfoo:latest"
}
}
}
],
"replicas": 1,
"test": false,
"selector": {
"io.kompose.service": "appfoo"
},
"template": {
"metadata": {
"creationTimestamp": null,
"labels": {
"io.kompose.network/app-network": "true",
"io.kompose.network/web-network": "true",
"io.kompose.service": "appfoo"
}
},
"spec": {
"containers": [
{
"name": "appfoo",
"image": " ",
"args": [
"sh",
"-c",
"echo Hello Foo"
],
"resources": {}
}
],
"restartPolicy": "Always"
}
}
},
"status": {}
},
{
"kind": "ImageStream",
"apiVersion": "v1",
"metadata": {
"name": "appfoo",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "appfoo"
}
},
"spec": {
"tags": [
{
"name": "latest",
"annotations": null,
"from": {
"kind": "DockerImage",
"name": "foo:latest"
},
"generation": null,
"importPolicy": {}
}
]
},
"status": {
"dockerImageRepository": ""
}
}
]
}