Add label support to named volumes in docker compose v3 to Kubernetes (#1083)

* Support read specific label (kompose.volume.size) from named volume and apply to kubernetes supported volume size

* Fix the PVC size in log message when deploy Kubernetes

* Skip creation of PersistentVolumeClaim if it is already created in the same kubernetes deploy

* Add selector to PersistentVolumeClaim only when specific label (kompose.volume.selector) is used in named volume

* Add test case to named-volume for the new labels
This commit is contained in:
huikaihoo
2018-11-29 12:07:17 -05:00
committed by Charlie Drage
parent ae44008908
commit d48ae64325
6 changed files with 256 additions and 19 deletions
+4
View File
@@ -185,6 +185,10 @@ cmd="kompose -f $KOMPOSE_ROOT/script/test/fixtures/volume-mounts/named-volume/do
sed -e "s;%VERSION%;$version;g" -e "s;%CMD%;$cmd;g" $KOMPOSE_ROOT/script/test/fixtures/volume-mounts/named-volume/output-k8s-template.json > /tmp/output-k8s.json
convert::expect_success "$cmd" "/tmp/output-k8s.json"
cmd="kompose -f $KOMPOSE_ROOT/script/test/fixtures/volume-mounts/named-volume/docker-compose-v3.yml convert --stdout -j"
sed -e "s;%VERSION%;$version;g" -e "s;%CMD%;$cmd;g" $KOMPOSE_ROOT/script/test/fixtures/volume-mounts/named-volume/output-k8s-v3.json > /tmp/output-k8s.json
convert::expect_success "$cmd" "/tmp/output-k8s.json"
# openshift test
cmd="kompose --provider=openshift -f $KOMPOSE_ROOT/script/test/fixtures/volume-mounts/named-volume/docker-compose.yml convert --stdout -j"
sed -e "s;%VERSION%;$version;g" -e "s;%CMD%;$cmd;g" $KOMPOSE_ROOT/script/test/fixtures/volume-mounts/named-volume/output-os-template.json > /tmp/output-os.json