This does a major refactor on the compose.go functions as well as brings
in a new era of v3 support to Kompose.
Similar to how we utilize libcompose, we utilize docker/cli's "stack
deploy" code which has a built-in v3 parser. We convert the parsed
structure to our own and then convert it to Kubernetes/OpenShift
artifacts.
If test in `make test-cmd` is failing, now it will show diff so that
it will be easy to debug.
for example,
```
===> Starting test <===
convert::expect_success_and_warning: Running: 'kompose -f /home/snarwade/go/src/github.com/kubernetes-incubator/kompose/script/test/fixtures/service-name-change/docker-compose.yml convert --stdout -j' expected_output: '/home/snarwade/go/src/github.com/kubernetes-incubator/kompose/script/test/fixtures/service-name-change/output-k8s.json' expected_warning: 'Unsupported root level volumes key - ignoring'
WARN Unsupported root level volumes key - ignoring
WARN Unsupported depends_on key - ignoring
103c103
< "value": "bitnami_wordpres"
---
> "value": "bitnami_wordpress"
FAIL: converted output does not match
```
* Two new scripts testing kompose-specific labels have been added:
script/test_in_openshift/tests/routes-service-expose-hostname.sh
script/test_in_openshift/tests/routes-service-expose-true.sh
* Tests for buildconfig dockerfile construct has been added:
script/test_in_openshift/tests/buildconfig_dockerfile.sh
* Tests for restart option:
script/test_in_openshift/tests/restart-options.sh
* Ability to run individual scripts: Changes have been made to script/test_in_openshift/run.sh
for running individual scripts:
Eg. ./script/test_in_openshift/run.sh script/test_in_openshift/tests/routes-service-expose-true.sh
now args provided under build in docker-compose file can be available in buildconfig.
it solves #406
Added unit test and functional test
solves #445
Separated key:"value" pairs by spaces
Resolves#576
This PR includes `output-os-template.json` in `nginx-node-redis` example,
which is basically output template contains `%URI%` and `%REF%` variables
which will be filled while initializing test cases and new will be stored as
`/tmp/output-os.json`
This will remove the problem of git uri and ref.
* This PR adds functional tests for kompose up/down. The test scripts
are hosted under script/test_in_openshift. The directory structure,
as follows:
script/test_in_openshift/
├── compose-files
│ └── docker-compose-command.yml
├── lib.sh
├── run.sh
└── tests
├── buildconfig.sh
├── entrypoint-command.sh
├── etherpad.sh
└── redis-replica-2.sh
* script/test_in_openshift/run.sh is the master script
which executes all the tests
* script/test_in_openshift/lib.sh consists of helper functions
for `kompose up` and `kompose down` checks
* script/test_in_openshift/tests directory consists of test scripts
* The scripts use 'oc cluster up' for setting up a single-machine
OpenShift cluster. It exits if oc binaries are not installed
* Most of the docker compose files used are the ones already
available in examples/ or script/test/fixtures.
* How to run the tests: 'make test-openshift'
Removes the '$CLI' portion of uploading the binaries / tarballs. Had a
naming error when uploading.
Updates it so we cd to `bin` so we can create the tarballs without the
`/bin` folder being located within it.
Updates the release script to use the actual GOPATH directory as
previous problems with commit hashes / versions in `kompose version`.
Cleans this up in regards to all the `cd` and `cd ..` commands.
No need to `git clone`.
fixes#445
This PR was partially fixed by docker/libcompose#450, which now gives consistent build context,
also it modifies the function getAbsBuildContext to create accurate build context, Unit test are being modified
according to new structure.
If we have a docker-file with root level volumes and we do a kompose up
using that docker-file, libcompose will add an additional _ followed by
the current directory name. Since kubernetes doesn't allow _ in the
objects created so kompose up will fail to deploy it. As a solution we
replace _ to - and we can then deploy it successfully.
This PR uses the "SelectorFromSet()" function which takes alabel or
selector as an argument returns all the object that uses that label or
selector. Once we get the object that uses a particular label we can
further do the delete operation on them. This is similar to "kubectl
delete <object> --selector=<key>=<value>". Also the label has been
modified from service to io.kompose.service.
This adds the functionality for Travis to sync with http://kompose.io in
regards to "syncing" the docs directory in master and the docs within
gh-pages.
Two things are added:
script/sync-docs/sh
script/deploy_key.enc
The encrypted key follows the conventions here:
https://gist.github.com/domenic/ec8b0fc8ab45f39403dd
and the functionality of running: `travis encrypt-file encrypt_key`
The script is ran each-time a PR is merged (and only if it's
sucessful!) as per the modifications in `.travis.yml`.
Thus each time we make a change in master, there's no need to open up
another PR for syncing the changes with `gh-pages`.
When volumes are specified in the Docker Compose
files, then in case of Kubernetes, Deployment's
Spec.Strategy.Type and in case of OpenShift,
DeploymentConfig's Spec.Strategy.Type are set to
"Recreate". This is a safer deployment strategy
when Volumes are getting used.
This commit also adds unit tests for Kubernetes
as well as OpenShift, and fixes the failing
functional tests (tests.sh) due to the change.
No functional tests have been added since
the functionality is already covered when the
volume mounts are being tested earlier in the
file.
This fixes#264
This adds support for supplying for example:
"127.0.0.1:80:80/tcp" to docker-compose.yaml and converting it to it's
corresponding Kubernetes / OpenShift hostIP.
This commit also refactors the loadPorts function of compose.go
Closes https://github.com/kubernetes-incubator/kompose/issues/335
If TCP is passed in as the protocol, by default, we add TCP as the
protocol within the Kubernetes or OpenShift artifacts.
By default, TCP is already selected within Kubernetes and thus having
the TCP output is redundant.
This commit checks to see if TCP has already been selected, and if it
has, ignores adding it to the list of ports.
Closes https://github.com/kubernetes-incubator/kompose/issues/392
This updates the release script to add the changelog gem as well as
clean up some of the scripts.
This also updates the binaries being uploaded and the messages being
passed onto the tag description on GitHub.