Support read data from stdin

This commit is contained in:
Hang Yan
2018-08-09 22:46:41 +08:00
parent 0252213efb
commit a012fba1c2
6 changed files with 79 additions and 20 deletions
+4 -2
View File
@@ -805,8 +805,10 @@ sed -e "s;%VERSION%;$version;g" -e "s;%CMD%;$cmd;g" $KOMPOSE_ROOT/script/test/f
convert::expect_success "$cmd" "/tmp/output-os.json"
# Testing stdin feature
cmd="$KOMPOSE_ROOT/kompose convert --stdout -j -f -"
sed -e "s;%VERSION%;$version;g" -e "s;%CMD%;$cmd;g" $KOMPOSE_ROOT/script/test/fixtures/stdin/output.json > /tmp/output-k8s.json
cmd="kompose convert --stdout -j -f -"
sed -e "s;%VERSION%;$version;g" -e "s;%CMD%;$cmd;g" $KOMPOSE_ROOT/script/test/fixtures/stdin/output-k8s.json > /tmp/output-k8s.json
cat $KOMPOSE_ROOT/script/test/fixtures/stdin/docker-compose.yaml | $cmd | diff /tmp/output-k8s.json -
EXIT_STATUS=$?
echo -e "\n"
go test -v github.com/kubernetes/kompose/script/test/cmd