forked from LaconicNetwork/kompose
Fix merge compose file's replicas error (#1446)
This commit is contained in:
parent
c7ba832556
commit
a87dd94532
@ -741,6 +741,9 @@ func mergeComposeObject(oldCompose *types.Config, newCompose *types.Config) (*ty
|
||||
if service.Deploy.Resources.Reservations != nil {
|
||||
tmpOldService.Deploy.Resources.Reservations = service.Deploy.Resources.Reservations
|
||||
}
|
||||
if service.Deploy.Replicas != nil {
|
||||
tmpOldService.Deploy.Replicas = service.Deploy.Replicas
|
||||
}
|
||||
|
||||
if len(service.Devices) != 0 {
|
||||
// merge the 2 sets of values
|
||||
@ -748,6 +751,7 @@ func mergeComposeObject(oldCompose *types.Config, newCompose *types.Config) (*ty
|
||||
// Not implemented yet as we don't convert devices to k8s anyway
|
||||
tmpOldService.Devices = service.Devices
|
||||
}
|
||||
|
||||
if len(service.DNS) != 0 {
|
||||
// concat the 2 sets of values
|
||||
tmpOldService.DNS = append(tmpOldService.DNS, service.DNS...)
|
||||
@ -791,6 +795,7 @@ func mergeComposeObject(oldCompose *types.Config, newCompose *types.Config) (*ty
|
||||
if service.Image != "" {
|
||||
tmpOldService.Image = service.Image
|
||||
}
|
||||
|
||||
if service.Ipc != "" {
|
||||
tmpOldService.Ipc = service.Ipc
|
||||
}
|
||||
|
||||
@ -146,4 +146,12 @@ convert::expect_success "$ocp_cmd" "$ocp_output"
|
||||
# test service group by volume, not support openshift for now
|
||||
k8s_cmd="kompose -f $KOMPOSE_ROOT/script/test/fixtures/service-group/compose.yaml convert --stdout -j --with-kompose-annotation=false --service-group-mode=volume"
|
||||
k8s_output="$KOMPOSE_ROOT/script/test/fixtures/service-group/output-k8s.json"
|
||||
convert::expect_success_and_warning "$k8s_cmd" "$k8s_output"
|
||||
convert::expect_success_and_warning "$k8s_cmd" "$k8s_output"
|
||||
|
||||
# test merge multiple compose files
|
||||
k8s_cmd="kompose -f $KOMPOSE_ROOT/script/test/fixtures/multiple-files/first.yaml -f $KOMPOSE_ROOT/script/test/fixtures/multiple-files/second.yaml convert --stdout -j --with-kompose-annotation=false"
|
||||
ocp_cmd="kompose --provider=openshift -f $KOMPOSE_ROOT/script/test/fixtures/multiple-files/first.yaml -f $KOMPOSE_ROOT/script/test/fixtures/multiple-files/second.yaml convert --stdout -j --with-kompose-annotation=false"
|
||||
k8s_output="$KOMPOSE_ROOT/script/test/fixtures/multiple-files/output-k8s.json"
|
||||
ocp_output="$KOMPOSE_ROOT/script/test/fixtures/multiple-files/output-ocp.json"
|
||||
convert::expect_success_and_warning "$k8s_cmd" "$k8s_output"
|
||||
convert::expect_success "$ocp_cmd" "$ocp_output"
|
||||
|
||||
@ -1,27 +0,0 @@
|
||||
version: "2"
|
||||
|
||||
services:
|
||||
mariadb:
|
||||
image: centos/mariadb
|
||||
ports:
|
||||
- "3306"
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: kubernetes
|
||||
MYSQL_DATABASE: kubernetes
|
||||
MYSQL_PASSWORD: kubernetes
|
||||
MYSQL_USER: kubernetes
|
||||
volumes:
|
||||
- /var/lib/mysql
|
||||
|
||||
etherpad:
|
||||
image: centos/etherpad
|
||||
ports:
|
||||
- "80:9001"
|
||||
depends_on:
|
||||
- mariadb
|
||||
environment:
|
||||
DB_HOST: kubernetes
|
||||
DB_DBID: kubernetes
|
||||
DB_PASS: kubernetes
|
||||
DB_PORT: kubernetes
|
||||
DB_USER: kubernetes
|
||||
@ -1,27 +0,0 @@
|
||||
version: "2"
|
||||
|
||||
services:
|
||||
mariadb:
|
||||
image: centos/mariadb
|
||||
ports:
|
||||
- "3307"
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: openshift
|
||||
MYSQL_DATABASE: openshift
|
||||
MYSQL_PASSWORD: openshift
|
||||
MYSQL_USER: openshift
|
||||
volumes:
|
||||
- /var/lib/mysql
|
||||
|
||||
etherpad:
|
||||
image: centos/etherpad
|
||||
ports:
|
||||
- "80:9001"
|
||||
depends_on:
|
||||
- mariadb
|
||||
environment:
|
||||
DB_HOST: openshift
|
||||
DB_DBID: openshift
|
||||
DB_PASS: openshift
|
||||
DB_PORT: openshift
|
||||
DB_USER: openshift
|
||||
@ -1,299 +0,0 @@
|
||||
{
|
||||
"kind": "List",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {},
|
||||
"items": [
|
||||
{
|
||||
"kind": "Service",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "etherpad",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"io.kompose.service": "etherpad"
|
||||
},
|
||||
"annotations": {
|
||||
"kompose.cmd": "%CMD%",
|
||||
"kompose.version": "%VERSION%"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"ports": [
|
||||
{
|
||||
"name": "80",
|
||||
"port": 80,
|
||||
"targetPort": 9001
|
||||
},
|
||||
{
|
||||
"name": "80-tcp",
|
||||
"port": 80,
|
||||
"targetPort": 9001
|
||||
}
|
||||
],
|
||||
"selector": {
|
||||
"io.kompose.service": "etherpad"
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"loadBalancer": {}
|
||||
}
|
||||
},
|
||||
{
|
||||
"kind": "Service",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "mariadb",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"io.kompose.service": "mariadb"
|
||||
},
|
||||
"annotations": {
|
||||
"kompose.cmd": "%CMD%",
|
||||
"kompose.version": "%VERSION%"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"ports": [
|
||||
{
|
||||
"name": "3306",
|
||||
"port": 3306,
|
||||
"targetPort": 3306
|
||||
},
|
||||
{
|
||||
"name": "3307",
|
||||
"port": 3307,
|
||||
"targetPort": 3307
|
||||
}
|
||||
],
|
||||
"selector": {
|
||||
"io.kompose.service": "mariadb"
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"loadBalancer": {}
|
||||
}
|
||||
},
|
||||
{
|
||||
"apiVersion": "apps/v1",
|
||||
"kind": "Deployment",
|
||||
"metadata": {
|
||||
"annotations": {
|
||||
"kompose.cmd": "%CMD%",
|
||||
"kompose.version": "%VERSION%"
|
||||
},
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"io.kompose.service": "etherpad"
|
||||
},
|
||||
"name": "etherpad"
|
||||
},
|
||||
"spec": {
|
||||
"replicas": 1,
|
||||
"selector": {
|
||||
"matchLabels": {
|
||||
"io.kompose.service": "etherpad"
|
||||
}
|
||||
},
|
||||
"strategy": {},
|
||||
"template": {
|
||||
"metadata": {
|
||||
"annotations": {
|
||||
"kompose.cmd": "%CMD%",
|
||||
"kompose.version": "%VERSION%"
|
||||
},
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"io.kompose.service": "etherpad"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"containers": [
|
||||
{
|
||||
"env": [
|
||||
{
|
||||
"name": "DB_DBID",
|
||||
"value": "openshift"
|
||||
},
|
||||
{
|
||||
"name": "DB_HOST",
|
||||
"value": "openshift"
|
||||
},
|
||||
{
|
||||
"name": "DB_PASS",
|
||||
"value": "openshift"
|
||||
},
|
||||
{
|
||||
"name": "DB_PORT",
|
||||
"value": "openshift"
|
||||
},
|
||||
{
|
||||
"name": "DB_USER",
|
||||
"value": "openshift"
|
||||
}
|
||||
],
|
||||
"image": "centos/etherpad",
|
||||
"imagePullPolicy": "",
|
||||
"name": "etherpad",
|
||||
"ports": [
|
||||
{
|
||||
"containerPort": 9001
|
||||
}
|
||||
],
|
||||
"resources": {}
|
||||
}
|
||||
],
|
||||
"restartPolicy": "Always",
|
||||
"serviceAccountName": "",
|
||||
"volumes": null
|
||||
}
|
||||
}
|
||||
},
|
||||
"status": {}
|
||||
},
|
||||
{
|
||||
"apiVersion": "apps/v1",
|
||||
"kind": "Deployment",
|
||||
"metadata": {
|
||||
"annotations": {
|
||||
"kompose.cmd": "%CMD%",
|
||||
"kompose.version": "%VERSION%"
|
||||
},
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"io.kompose.service": "mariadb"
|
||||
},
|
||||
"name": "mariadb"
|
||||
},
|
||||
"spec": {
|
||||
"replicas": 1,
|
||||
"selector": {
|
||||
"matchLabels": {
|
||||
"io.kompose.service": "mariadb"
|
||||
}
|
||||
},
|
||||
"strategy": {
|
||||
"type": "Recreate"
|
||||
},
|
||||
"template": {
|
||||
"metadata": {
|
||||
"annotations": {
|
||||
"kompose.cmd": "%CMD%",
|
||||
"kompose.version": "%VERSION%"
|
||||
},
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"io.kompose.service": "mariadb"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"containers": [
|
||||
{
|
||||
"env": [
|
||||
{
|
||||
"name": "MYSQL_DATABASE",
|
||||
"value": "openshift"
|
||||
},
|
||||
{
|
||||
"name": "MYSQL_PASSWORD",
|
||||
"value": "openshift"
|
||||
},
|
||||
{
|
||||
"name": "MYSQL_ROOT_PASSWORD",
|
||||
"value": "openshift"
|
||||
},
|
||||
{
|
||||
"name": "MYSQL_USER",
|
||||
"value": "openshift"
|
||||
}
|
||||
],
|
||||
"image": "centos/mariadb",
|
||||
"imagePullPolicy": "",
|
||||
"name": "mariadb",
|
||||
"ports": [
|
||||
{
|
||||
"containerPort": 3306
|
||||
},
|
||||
{
|
||||
"containerPort": 3307
|
||||
}
|
||||
],
|
||||
"resources": {},
|
||||
"volumeMounts": [
|
||||
{
|
||||
"mountPath": "/var/lib/mysql",
|
||||
"name": "mariadb-claim0"
|
||||
},
|
||||
{
|
||||
"mountPath": "/var/lib/mysql",
|
||||
"name": "mariadb-claim1"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"restartPolicy": "Always",
|
||||
"serviceAccountName": "",
|
||||
"volumes": [
|
||||
{
|
||||
"name": "mariadb-claim0",
|
||||
"persistentVolumeClaim": {
|
||||
"claimName": "mariadb-claim0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "mariadb-claim1",
|
||||
"persistentVolumeClaim": {
|
||||
"claimName": "mariadb-claim1"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"status": {}
|
||||
},
|
||||
{
|
||||
"kind": "PersistentVolumeClaim",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "mariadb-claim0",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"io.kompose.service": "mariadb-claim0"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"accessModes": [
|
||||
"ReadWriteOnce"
|
||||
],
|
||||
"resources": {
|
||||
"requests": {
|
||||
"storage": "100Mi"
|
||||
}
|
||||
}
|
||||
},
|
||||
"status": {}
|
||||
},
|
||||
{
|
||||
"kind": "PersistentVolumeClaim",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "mariadb-claim1",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"io.kompose.service": "mariadb-claim1"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"accessModes": [
|
||||
"ReadWriteOnce"
|
||||
],
|
||||
"resources": {
|
||||
"requests": {
|
||||
"storage": "100Mi"
|
||||
}
|
||||
}
|
||||
},
|
||||
"status": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -1,379 +0,0 @@
|
||||
{
|
||||
"kind": "List",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {},
|
||||
"items": [
|
||||
{
|
||||
"kind": "Service",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "etherpad",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"io.kompose.service": "etherpad"
|
||||
},
|
||||
"annotations": {
|
||||
"kompose.cmd": "%CMD%",
|
||||
"kompose.version": "%VERSION%"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"ports": [
|
||||
{
|
||||
"name": "80",
|
||||
"port": 80,
|
||||
"targetPort": 9001
|
||||
},
|
||||
{
|
||||
"name": "80-tcp",
|
||||
"port": 80,
|
||||
"targetPort": 9001
|
||||
}
|
||||
],
|
||||
"selector": {
|
||||
"io.kompose.service": "etherpad"
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"loadBalancer": {}
|
||||
}
|
||||
},
|
||||
{
|
||||
"kind": "Service",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "mariadb",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"io.kompose.service": "mariadb"
|
||||
},
|
||||
"annotations": {
|
||||
"kompose.cmd": "%CMD%",
|
||||
"kompose.version": "%VERSION%"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"ports": [
|
||||
{
|
||||
"name": "3306",
|
||||
"port": 3306,
|
||||
"targetPort": 3306
|
||||
},
|
||||
{
|
||||
"name": "3307",
|
||||
"port": 3307,
|
||||
"targetPort": 3307
|
||||
}
|
||||
],
|
||||
"selector": {
|
||||
"io.kompose.service": "mariadb"
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"loadBalancer": {}
|
||||
}
|
||||
},
|
||||
{
|
||||
"kind": "DeploymentConfig",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "etherpad",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"io.kompose.service": "etherpad"
|
||||
},
|
||||
"annotations": {
|
||||
"kompose.cmd": "%CMD%",
|
||||
"kompose.version": "%VERSION%"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"strategy": {
|
||||
"resources": {}
|
||||
},
|
||||
"triggers": [
|
||||
{
|
||||
"type": "ConfigChange"
|
||||
},
|
||||
{
|
||||
"type": "ImageChange",
|
||||
"imageChangeParams": {
|
||||
"automatic": true,
|
||||
"containerNames": [
|
||||
"etherpad"
|
||||
],
|
||||
"from": {
|
||||
"kind": "ImageStreamTag",
|
||||
"name": "etherpad:latest"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"replicas": 1,
|
||||
"test": false,
|
||||
"selector": {
|
||||
"io.kompose.service": "etherpad"
|
||||
},
|
||||
"template": {
|
||||
"metadata": {
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"io.kompose.service": "etherpad"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"containers": [
|
||||
{
|
||||
"name": "etherpad",
|
||||
"image": " ",
|
||||
"ports": [
|
||||
{
|
||||
"containerPort": 9001
|
||||
}
|
||||
],
|
||||
"env": [
|
||||
{
|
||||
"name": "DB_DBID",
|
||||
"value": "openshift"
|
||||
},
|
||||
{
|
||||
"name": "DB_HOST",
|
||||
"value": "openshift"
|
||||
},
|
||||
{
|
||||
"name": "DB_PASS",
|
||||
"value": "openshift"
|
||||
},
|
||||
{
|
||||
"name": "DB_PORT",
|
||||
"value": "openshift"
|
||||
},
|
||||
{
|
||||
"name": "DB_USER",
|
||||
"value": "openshift"
|
||||
}
|
||||
],
|
||||
"resources": {}
|
||||
}
|
||||
],
|
||||
"restartPolicy": "Always"
|
||||
}
|
||||
}
|
||||
},
|
||||
"status": {}
|
||||
},
|
||||
{
|
||||
"kind": "ImageStream",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "etherpad",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"io.kompose.service": "etherpad"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"tags": [
|
||||
{
|
||||
"name": "latest",
|
||||
"annotations": null,
|
||||
"from": {
|
||||
"kind": "DockerImage",
|
||||
"name": "centos/etherpad"
|
||||
},
|
||||
"generation": null,
|
||||
"importPolicy": {}
|
||||
}
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"dockerImageRepository": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"kind": "DeploymentConfig",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "mariadb",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"io.kompose.service": "mariadb"
|
||||
},
|
||||
"annotations": {
|
||||
"kompose.cmd": "%CMD%",
|
||||
"kompose.version": "%VERSION%"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"strategy": {
|
||||
"type": "Recreate",
|
||||
"resources": {}
|
||||
},
|
||||
"triggers": [
|
||||
{
|
||||
"type": "ConfigChange"
|
||||
},
|
||||
{
|
||||
"type": "ImageChange",
|
||||
"imageChangeParams": {
|
||||
"automatic": true,
|
||||
"containerNames": [
|
||||
"mariadb"
|
||||
],
|
||||
"from": {
|
||||
"kind": "ImageStreamTag",
|
||||
"name": "mariadb:latest"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"replicas": 1,
|
||||
"test": false,
|
||||
"selector": {
|
||||
"io.kompose.service": "mariadb"
|
||||
},
|
||||
"template": {
|
||||
"metadata": {
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"io.kompose.service": "mariadb"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"volumes": [
|
||||
{
|
||||
"name": "mariadb-claim0",
|
||||
"persistentVolumeClaim": {
|
||||
"claimName": "mariadb-claim0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "mariadb-claim1",
|
||||
"persistentVolumeClaim": {
|
||||
"claimName": "mariadb-claim1"
|
||||
}
|
||||
}
|
||||
],
|
||||
"containers": [
|
||||
{
|
||||
"name": "mariadb",
|
||||
"image": " ",
|
||||
"ports": [
|
||||
{
|
||||
"containerPort": 3306
|
||||
},
|
||||
{
|
||||
"containerPort": 3307
|
||||
}
|
||||
],
|
||||
"env": [
|
||||
{
|
||||
"name": "MYSQL_DATABASE",
|
||||
"value": "openshift"
|
||||
},
|
||||
{
|
||||
"name": "MYSQL_PASSWORD",
|
||||
"value": "openshift"
|
||||
},
|
||||
{
|
||||
"name": "MYSQL_ROOT_PASSWORD",
|
||||
"value": "openshift"
|
||||
},
|
||||
{
|
||||
"name": "MYSQL_USER",
|
||||
"value": "openshift"
|
||||
}
|
||||
],
|
||||
"resources": {},
|
||||
"volumeMounts": [
|
||||
{
|
||||
"name": "mariadb-claim0",
|
||||
"mountPath": "/var/lib/mysql"
|
||||
},
|
||||
{
|
||||
"name": "mariadb-claim1",
|
||||
"mountPath": "/var/lib/mysql"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"restartPolicy": "Always"
|
||||
}
|
||||
}
|
||||
},
|
||||
"status": {}
|
||||
},
|
||||
{
|
||||
"kind": "ImageStream",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "mariadb",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"io.kompose.service": "mariadb"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"tags": [
|
||||
{
|
||||
"name": "latest",
|
||||
"annotations": null,
|
||||
"from": {
|
||||
"kind": "DockerImage",
|
||||
"name": "centos/mariadb"
|
||||
},
|
||||
"generation": null,
|
||||
"importPolicy": {}
|
||||
}
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"dockerImageRepository": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"kind": "PersistentVolumeClaim",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "mariadb-claim0",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"io.kompose.service": "mariadb-claim0"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"accessModes": [
|
||||
"ReadWriteOnce"
|
||||
],
|
||||
"resources": {
|
||||
"requests": {
|
||||
"storage": "100Mi"
|
||||
}
|
||||
}
|
||||
},
|
||||
"status": {}
|
||||
},
|
||||
{
|
||||
"kind": "PersistentVolumeClaim",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "mariadb-claim1",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"io.kompose.service": "mariadb-claim1"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"accessModes": [
|
||||
"ReadWriteOnce"
|
||||
],
|
||||
"resources": {
|
||||
"requests": {
|
||||
"storage": "100Mi"
|
||||
}
|
||||
}
|
||||
},
|
||||
"status": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
9
script/test/fixtures/multiple-files/first.yaml
vendored
Normal file
9
script/test/fixtures/multiple-files/first.yaml
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
version: "3.5"
|
||||
services:
|
||||
foo:
|
||||
image: foo
|
||||
deploy:
|
||||
replicas: 3
|
||||
|
||||
bar:
|
||||
image: bar
|
||||
85
script/test/fixtures/multiple-files/output-k8s.json
vendored
Normal file
85
script/test/fixtures/multiple-files/output-k8s.json
vendored
Normal file
@ -0,0 +1,85 @@
|
||||
{
|
||||
"kind": "List",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {},
|
||||
"items": [
|
||||
{
|
||||
"kind": "Deployment",
|
||||
"apiVersion": "apps/v1",
|
||||
"metadata": {
|
||||
"name": "bar",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"io.kompose.service": "bar"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"replicas": 99,
|
||||
"selector": {
|
||||
"matchLabels": {
|
||||
"io.kompose.service": "bar"
|
||||
}
|
||||
},
|
||||
"template": {
|
||||
"metadata": {
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"io.kompose.service": "bar"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"containers": [
|
||||
{
|
||||
"name": "bar",
|
||||
"image": "bar",
|
||||
"resources": {}
|
||||
}
|
||||
],
|
||||
"restartPolicy": "Always"
|
||||
}
|
||||
},
|
||||
"strategy": {}
|
||||
},
|
||||
"status": {}
|
||||
},
|
||||
{
|
||||
"kind": "Deployment",
|
||||
"apiVersion": "apps/v1",
|
||||
"metadata": {
|
||||
"name": "foo",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"io.kompose.service": "foo"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"replicas": 3,
|
||||
"selector": {
|
||||
"matchLabels": {
|
||||
"io.kompose.service": "foo"
|
||||
}
|
||||
},
|
||||
"template": {
|
||||
"metadata": {
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"io.kompose.service": "foo"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"containers": [
|
||||
{
|
||||
"name": "foo",
|
||||
"image": "foo",
|
||||
"resources": {}
|
||||
}
|
||||
],
|
||||
"restartPolicy": "Always"
|
||||
}
|
||||
},
|
||||
"strategy": {}
|
||||
},
|
||||
"status": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
205
script/test/fixtures/multiple-files/output-ocp.json
vendored
Normal file
205
script/test/fixtures/multiple-files/output-ocp.json
vendored
Normal file
@ -0,0 +1,205 @@
|
||||
{
|
||||
"kind": "List",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {},
|
||||
"items": [
|
||||
{
|
||||
"kind": "DeploymentConfig",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "bar",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"io.kompose.service": "bar"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"strategy": {
|
||||
"resources": {}
|
||||
},
|
||||
"triggers": [
|
||||
{
|
||||
"type": "ConfigChange"
|
||||
},
|
||||
{
|
||||
"type": "ImageChange",
|
||||
"imageChangeParams": {
|
||||
"automatic": true,
|
||||
"containerNames": [
|
||||
"bar"
|
||||
],
|
||||
"from": {
|
||||
"kind": "ImageStreamTag",
|
||||
"name": "bar:latest"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"replicas": 99,
|
||||
"test": false,
|
||||
"selector": {
|
||||
"io.kompose.service": "bar"
|
||||
},
|
||||
"template": {
|
||||
"metadata": {
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"io.kompose.service": "bar"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"containers": [
|
||||
{
|
||||
"name": "bar",
|
||||
"image": " ",
|
||||
"resources": {}
|
||||
}
|
||||
],
|
||||
"restartPolicy": "Always"
|
||||
}
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"latestVersion": 0,
|
||||
"observedGeneration": 0,
|
||||
"replicas": 0,
|
||||
"updatedReplicas": 0,
|
||||
"availableReplicas": 0,
|
||||
"unavailableReplicas": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"kind": "ImageStream",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "bar",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"io.kompose.service": "bar"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"lookupPolicy": {
|
||||
"local": false
|
||||
},
|
||||
"tags": [
|
||||
{
|
||||
"name": "",
|
||||
"annotations": null,
|
||||
"from": {
|
||||
"kind": "DockerImage",
|
||||
"name": "bar"
|
||||
},
|
||||
"generation": null,
|
||||
"importPolicy": {},
|
||||
"referencePolicy": {
|
||||
"type": ""
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"dockerImageRepository": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"kind": "DeploymentConfig",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "foo",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"io.kompose.service": "foo"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"strategy": {
|
||||
"resources": {}
|
||||
},
|
||||
"triggers": [
|
||||
{
|
||||
"type": "ConfigChange"
|
||||
},
|
||||
{
|
||||
"type": "ImageChange",
|
||||
"imageChangeParams": {
|
||||
"automatic": true,
|
||||
"containerNames": [
|
||||
"foo"
|
||||
],
|
||||
"from": {
|
||||
"kind": "ImageStreamTag",
|
||||
"name": "foo:latest"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"replicas": 3,
|
||||
"test": false,
|
||||
"selector": {
|
||||
"io.kompose.service": "foo"
|
||||
},
|
||||
"template": {
|
||||
"metadata": {
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"io.kompose.service": "foo"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"containers": [
|
||||
{
|
||||
"name": "foo",
|
||||
"image": " ",
|
||||
"resources": {}
|
||||
}
|
||||
],
|
||||
"restartPolicy": "Always"
|
||||
}
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"latestVersion": 0,
|
||||
"observedGeneration": 0,
|
||||
"replicas": 0,
|
||||
"updatedReplicas": 0,
|
||||
"availableReplicas": 0,
|
||||
"unavailableReplicas": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"kind": "ImageStream",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "foo",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"io.kompose.service": "foo"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"lookupPolicy": {
|
||||
"local": false
|
||||
},
|
||||
"tags": [
|
||||
{
|
||||
"name": "",
|
||||
"annotations": null,
|
||||
"from": {
|
||||
"kind": "DockerImage",
|
||||
"name": "foo"
|
||||
},
|
||||
"generation": null,
|
||||
"importPolicy": {},
|
||||
"referencePolicy": {
|
||||
"type": ""
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"dockerImageRepository": ""
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
5
script/test/fixtures/multiple-files/second.yaml
vendored
Normal file
5
script/test/fixtures/multiple-files/second.yaml
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
version: "3.5"
|
||||
services:
|
||||
bar:
|
||||
deploy:
|
||||
replicas: 99
|
||||
Loading…
Reference in New Issue
Block a user