forked from LaconicNetwork/kompose
Add support for Config, endpoint_mode and 3.3 support (#994)
* Add support for Config * Add deployment endpoint_mode support * Add docker compose 3.3 support * Add compose v3.3 support for openshift
This commit is contained in:
committed by
Charlie Drage
parent
0c01309fe8
commit
0252213efb
@@ -766,6 +766,44 @@ cmd="kompose --provider=openshift convert --stdout -j -f $KOMPOSE_ROOT/script/te
|
||||
sed -e "s;%VERSION%;$version;g" -e "s;%CMD%;$cmd;g" $KOMPOSE_ROOT/script/test/fixtures/controller/output-os-controller-v3-template.json > /tmp/output-os.json
|
||||
convert::expect_success "$cmd" "/tmp/output-os.json"
|
||||
|
||||
cmd="kompose convert --stdout -j -f $KOMPOSE_ROOT/script/test/fixtures/compose-v3.3-test/compose-config-short.yaml"
|
||||
sed -e "s;%VERSION%;$version;g" -e "s;%CMD%;$cmd;g" $KOMPOSE_ROOT/script/test/fixtures/compose-v3.3-test/output-k8s-config-short.json > /tmp/output-k8s.json
|
||||
convert::expect_success_and_warning "$cmd" "/tmp/output-k8s.json"
|
||||
|
||||
cmd="kompose convert --stdout -j -f $KOMPOSE_ROOT/script/test/fixtures/compose-v3.3-test/compose-config-short-warning.yaml"
|
||||
sed -e "s;%VERSION%;$version;g" -e "s;%CMD%;$cmd;g" $KOMPOSE_ROOT/script/test/fixtures/compose-v3.3-test/output-k8s-config-short-warning.json > /tmp/output-k8s.json
|
||||
convert::expect_success_and_warning "$cmd" "/tmp/output-k8s.json"
|
||||
|
||||
cmd="kompose convert --stdout -j -f $KOMPOSE_ROOT/script/test/fixtures/compose-v3.3-test/compose-config-long.yaml"
|
||||
sed -e "s;%VERSION%;$version;g" -e "s;%CMD%;$cmd;g" $KOMPOSE_ROOT/script/test/fixtures/compose-v3.3-test/output-k8s-config-long.json > /tmp/output-k8s.json
|
||||
convert::expect_success_and_warning "$cmd" "/tmp/output-k8s.json"
|
||||
|
||||
cmd="kompose convert --stdout -j -f $KOMPOSE_ROOT/script/test/fixtures/compose-v3.3-test/compose-config-long-warning.yaml"
|
||||
sed -e "s;%VERSION%;$version;g" -e "s;%CMD%;$cmd;g" $KOMPOSE_ROOT/script/test/fixtures/compose-v3.3-test/output-k8s-config-long-warning.json > /tmp/output-k8s.json
|
||||
convert::expect_success_and_warning "$cmd" "/tmp/output-k8s.json"
|
||||
|
||||
## Test compose v3.3
|
||||
cmd="kompose convert --stdout -j -f $KOMPOSE_ROOT/script/test/fixtures/compose-v3.3-test/compose-endpoint-mode-1.yaml"
|
||||
sed -e "s;%VERSION%;$version;g" -e "s;%CMD%;$cmd;g" $KOMPOSE_ROOT/script/test/fixtures/compose-v3.3-test/output-k8s-endpoint-mode-1.json > /tmp/output-k8s.json
|
||||
convert::expect_success "$cmd" "/tmp/output-k8s.json"
|
||||
|
||||
cmd="kompose convert --stdout -j -f $KOMPOSE_ROOT/script/test/fixtures/compose-v3.3-test/compose-endpoint-mode-2.yaml"
|
||||
sed -e "s;%VERSION%;$version;g" -e "s;%CMD%;$cmd;g" $KOMPOSE_ROOT/script/test/fixtures/compose-v3.3-test/output-k8s-endpoint-mode-2.json > /tmp/output-k8s.json
|
||||
convert::expect_success "$cmd" "/tmp/output-k8s.json"
|
||||
|
||||
## Test OpenShift for compose v3.3
|
||||
cmd="kompose --provider openshift convert --stdout -j -f $KOMPOSE_ROOT/script/test/fixtures/compose-v3.3-test/compose-config-long.yaml"
|
||||
sed -e "s;%VERSION%;$version;g" -e "s;%CMD%;$cmd;g" $KOMPOSE_ROOT/script/test/fixtures/compose-v3.3-test/output-os-config-long.json > /tmp/output-os.json
|
||||
convert::expect_success_and_warning "$cmd" "/tmp/output-os.json"
|
||||
|
||||
cmd="kompose --provider openshift convert --stdout -j -f $KOMPOSE_ROOT/script/test/fixtures/compose-v3.3-test/compose-config-short.yaml"
|
||||
sed -e "s;%VERSION%;$version;g" -e "s;%CMD%;$cmd;g" $KOMPOSE_ROOT/script/test/fixtures/compose-v3.3-test/output-os-config-short.json > /tmp/output-os.json
|
||||
convert::expect_success_and_warning "$cmd" "/tmp/output-os.json"
|
||||
|
||||
cmd="kompose --provider openshift convert --stdout -j -f $KOMPOSE_ROOT/script/test/fixtures/compose-v3.3-test/compose-endpoint-mode-1.yaml"
|
||||
sed -e "s;%VERSION%;$version;g" -e "s;%CMD%;$cmd;g" $KOMPOSE_ROOT/script/test/fixtures/compose-v3.3-test/output-os-mode-1.json > /tmp/output-os.json
|
||||
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
|
||||
@@ -774,4 +812,4 @@ echo -e "\n"
|
||||
go test -v github.com/kubernetes/kompose/script/test/cmd
|
||||
|
||||
rm /tmp/output-k8s.json /tmp/output-os.json
|
||||
exit $EXIT_STATUS
|
||||
exit $EXIT_STATUS
|
||||
Reference in New Issue
Block a user