forked from LaconicNetwork/kompose
Merge top level non-service keys (#1187)
* merge top level non-service keys docker-compose default behaviour is to merge these top level keys such as `networks`
This commit is contained in:
@@ -0,0 +1 @@
|
||||
First config
|
||||
@@ -0,0 +1,15 @@
|
||||
version: "3.3"
|
||||
|
||||
services:
|
||||
other-toplevel-base:
|
||||
image: nginx
|
||||
volumes:
|
||||
- firstvolume:/var/www/nginx
|
||||
configs:
|
||||
- source: firstconfig
|
||||
target: /etc/nginx.conf
|
||||
mode: 644
|
||||
|
||||
configs:
|
||||
firstconfig:
|
||||
file: ./first_config.txt
|
||||
@@ -0,0 +1,20 @@
|
||||
version: "3.3"
|
||||
|
||||
services:
|
||||
other-toplevel-dev:
|
||||
image: nginx
|
||||
volumes:
|
||||
- firstvolume:/var/www/nginx
|
||||
configs:
|
||||
- source: firstconfig
|
||||
target: /etc/nginx.conf
|
||||
mode: 644
|
||||
|
||||
volumes:
|
||||
firstvolume:
|
||||
driver_opts:
|
||||
type: "nfs"
|
||||
|
||||
configs:
|
||||
firstconfig:
|
||||
file: ./first_config.txt
|
||||
@@ -0,0 +1,19 @@
|
||||
version: "3.3"
|
||||
|
||||
services:
|
||||
other-toplevel-second:
|
||||
image: nginx
|
||||
volumes:
|
||||
- secondvolume:/var/www/nginx
|
||||
configs:
|
||||
- source: secondconfig
|
||||
target: /etc/nginx.conf
|
||||
mode: 644
|
||||
|
||||
volumes:
|
||||
secondvolume:
|
||||
external: true
|
||||
|
||||
configs:
|
||||
secondconfig:
|
||||
file: ./second_config.txt
|
||||
@@ -0,0 +1,9 @@
|
||||
version: "3.3"
|
||||
|
||||
volumes:
|
||||
firstvolume:
|
||||
external: true
|
||||
|
||||
configs:
|
||||
firstconfig:
|
||||
file: ./second_config.txt
|
||||
+217
@@ -0,0 +1,217 @@
|
||||
{
|
||||
"kind": "List",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {},
|
||||
"items": [
|
||||
{
|
||||
"kind": "ConfigMap",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "firstconfig",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"io.kompose.service": "other-toplevel-dev"
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"first-config.txt": "First config\n"
|
||||
}
|
||||
},
|
||||
{
|
||||
"kind": "Deployment",
|
||||
"apiVersion": "extensions/v1beta1",
|
||||
"metadata": {
|
||||
"name": "other-toplevel-dev",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"io.kompose.service": "other-toplevel-dev"
|
||||
},
|
||||
"annotations": {
|
||||
"kompose.cmd": "%CMD%",
|
||||
"kompose.version": "%VERSION%"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"replicas": 1,
|
||||
"template": {
|
||||
"metadata": {
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"io.kompose.service": "other-toplevel-dev"
|
||||
},
|
||||
"annotations": {
|
||||
"kompose.cmd": "%CMD%",
|
||||
"kompose.version": "%VERSION%"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"volumes": [
|
||||
{
|
||||
"name": "firstconfig",
|
||||
"configMap": {
|
||||
"name": "firstconfig",
|
||||
"defaultMode": 644
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "firstvolume",
|
||||
"persistentVolumeClaim": {
|
||||
"claimName": "firstvolume"
|
||||
}
|
||||
}
|
||||
],
|
||||
"containers": [
|
||||
{
|
||||
"name": "other-toplevel-dev",
|
||||
"image": "nginx",
|
||||
"resources": {},
|
||||
"volumeMounts": [
|
||||
{
|
||||
"name": "firstconfig",
|
||||
"mountPath": "/nginx.conf"
|
||||
},
|
||||
{
|
||||
"name": "firstvolume",
|
||||
"mountPath": "/var/www/nginx"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"restartPolicy": "Always"
|
||||
}
|
||||
},
|
||||
"strategy": {
|
||||
"type": "Recreate"
|
||||
}
|
||||
},
|
||||
"status": {}
|
||||
},
|
||||
{
|
||||
"kind": "PersistentVolumeClaim",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "firstvolume",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"io.kompose.service": "firstvolume"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"accessModes": [
|
||||
"ReadWriteOnce"
|
||||
],
|
||||
"resources": {
|
||||
"requests": {
|
||||
"storage": "100Mi"
|
||||
}
|
||||
}
|
||||
},
|
||||
"status": {}
|
||||
},
|
||||
{
|
||||
"kind": "ConfigMap",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "secondconfig",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"io.kompose.service": "other-toplevel-second"
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"second-config.txt": "Second config\n"
|
||||
}
|
||||
},
|
||||
{
|
||||
"kind": "Deployment",
|
||||
"apiVersion": "extensions/v1beta1",
|
||||
"metadata": {
|
||||
"name": "other-toplevel-second",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"io.kompose.service": "other-toplevel-second"
|
||||
},
|
||||
"annotations": {
|
||||
"kompose.cmd": "%CMD%",
|
||||
"kompose.version": "%VERSION%"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"replicas": 1,
|
||||
"template": {
|
||||
"metadata": {
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"io.kompose.service": "other-toplevel-second"
|
||||
},
|
||||
"annotations": {
|
||||
"kompose.cmd": "%CMD%",
|
||||
"kompose.version": "%VERSION%"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"volumes": [
|
||||
{
|
||||
"name": "secondconfig",
|
||||
"configMap": {
|
||||
"name": "secondconfig",
|
||||
"defaultMode": 644
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "secondvolume",
|
||||
"persistentVolumeClaim": {
|
||||
"claimName": "secondvolume"
|
||||
}
|
||||
}
|
||||
],
|
||||
"containers": [
|
||||
{
|
||||
"name": "other-toplevel-second",
|
||||
"image": "nginx",
|
||||
"resources": {},
|
||||
"volumeMounts": [
|
||||
{
|
||||
"name": "secondconfig",
|
||||
"mountPath": "/nginx.conf"
|
||||
},
|
||||
{
|
||||
"name": "secondvolume",
|
||||
"mountPath": "/var/www/nginx"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"restartPolicy": "Always"
|
||||
}
|
||||
},
|
||||
"strategy": {
|
||||
"type": "Recreate"
|
||||
}
|
||||
},
|
||||
"status": {}
|
||||
},
|
||||
{
|
||||
"kind": "PersistentVolumeClaim",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "secondvolume",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"io.kompose.service": "secondvolume"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"accessModes": [
|
||||
"ReadWriteOnce"
|
||||
],
|
||||
"resources": {
|
||||
"requests": {
|
||||
"storage": "100Mi"
|
||||
}
|
||||
}
|
||||
},
|
||||
"status": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
+112
@@ -0,0 +1,112 @@
|
||||
{
|
||||
"kind": "List",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {},
|
||||
"items": [
|
||||
{
|
||||
"kind": "ConfigMap",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "firstconfig",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"io.kompose.service": "other-toplevel-base"
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"second-config.txt": "Second config\n"
|
||||
}
|
||||
},
|
||||
{
|
||||
"kind": "Deployment",
|
||||
"apiVersion": "extensions/v1beta1",
|
||||
"metadata": {
|
||||
"name": "other-toplevel-base",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"io.kompose.service": "other-toplevel-base"
|
||||
},
|
||||
"annotations": {
|
||||
"kompose.cmd": "%CMD%",
|
||||
"kompose.version": "%VERSION%"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"replicas": 1,
|
||||
"template": {
|
||||
"metadata": {
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"io.kompose.service": "other-toplevel-base"
|
||||
},
|
||||
"annotations": {
|
||||
"kompose.cmd": "%CMD%",
|
||||
"kompose.version": "%VERSION%"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"volumes": [
|
||||
{
|
||||
"name": "firstconfig",
|
||||
"configMap": {
|
||||
"name": "firstconfig",
|
||||
"defaultMode": 644
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "firstvolume",
|
||||
"persistentVolumeClaim": {
|
||||
"claimName": "firstvolume"
|
||||
}
|
||||
}
|
||||
],
|
||||
"containers": [
|
||||
{
|
||||
"name": "other-toplevel-base",
|
||||
"image": "nginx",
|
||||
"resources": {},
|
||||
"volumeMounts": [
|
||||
{
|
||||
"name": "firstconfig",
|
||||
"mountPath": "/nginx.conf"
|
||||
},
|
||||
{
|
||||
"name": "firstvolume",
|
||||
"mountPath": "/var/www/nginx"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"restartPolicy": "Always"
|
||||
}
|
||||
},
|
||||
"strategy": {
|
||||
"type": "Recreate"
|
||||
}
|
||||
},
|
||||
"status": {}
|
||||
},
|
||||
{
|
||||
"kind": "PersistentVolumeClaim",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "firstvolume",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"io.kompose.service": "firstvolume"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"accessModes": [
|
||||
"ReadWriteOnce"
|
||||
],
|
||||
"resources": {
|
||||
"requests": {
|
||||
"storage": "100Mi"
|
||||
}
|
||||
}
|
||||
},
|
||||
"status": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
Second config
|
||||
Reference in New Issue
Block a user