Fixed --volumes validation

Now, `--volumes` argument will validate it's input, it will only allow
`persistentVolumeClaim` or `emptyDir`, otherwise it will throw an error.
This commit is contained in:
Suraj Narwade
2017-09-25 17:25:57 +05:30
parent 99f88ef15c
commit 269f604094
3 changed files with 8 additions and 1 deletions
+3
View File
@@ -374,6 +374,9 @@ cmd="kompose convert -f $KOMPOSE_ROOT/script/test/fixtures/change-in-volume/dock
sed -e "s;%VERSION%;$version;g" -e "s;%CMD%;$cmd;g" $KOMPOSE_ROOT/script/test/fixtures/change-in-volume/output-k8s-empty-vols-template.json > /tmp/output-k8s.json
convert::expect_success_and_warning "kompose convert -f $KOMPOSE_ROOT/script/test/fixtures/change-in-volume/docker-compose.yml --stdout -j --volumes emptyDir" "/tmp/output-k8s.json" "Volume mount on the host "\"."\" isn't supported - ignoring path on the host"
#Failing test for `--volumes` option
convert::expect_failure "kompose convert --stdout -j -f $KOMPOSE_ROOT/script/test/fixtures/change-in-volume/docker-compose.yaml --volumes foobar"
# Test related to support docker-compose.yaml beside docker-compose.yml
# Store the original path
CURRENT_DIR=$(pwd)