opencompose
opencompose copied to clipboard
Mounting same volume to two different path generates invalid Deployment
It should possible to mount one volume to two different paths in the same container.
If I do this
version: 0.1-dev
services:
- name: foo
containers:
- image: tomaskral/sleeper
mounts:
- volumeName: data
mountPath: /data
- volumeName: data
mountPath: /data2
volumes:
- name: data
size: 100Mi
accessMode: ReadWriteOnce
it generates Deployment with two volumes with the same name. In this case data volume should be there only once.
...
volumes:
- name: data
persistentVolumeClaim:
claimName: data
- name: data
persistentVolumeClaim:
claimName: data
You get following error deploying generated Deployment
The Deployment "bar" is invalid: spec.template.spec.volumes[1].name: Duplicate value: "data"