Commit Graph

164 Commits

Author SHA1 Message Date
Tomas Kral
89cf88f665 Merge pull request #638 from surajnarwade/show-diff
Failing test will show diff
2017-06-14 09:28:30 +02:00
Charlie Drage
2b58307191 Add v3 support
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.
2017-06-13 09:44:48 -04:00
Suraj Narwade
883d11c049 Failing test will show diff
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
```
2017-06-13 14:20:52 +05:30
Suraj Narwade
581e181967 Validate dockerfilepath in buildconfig
This PR will resolve #594 by validating dockerfilepath based on whether
it is relative path or not.
2017-05-30 16:31:20 +05:30
Suraj Deshmukh
1c64b016dc Merge pull request #592 from cdrage/change-git-command
Use old git command
2017-05-18 09:12:09 +05:30
Tomas Kral
792976da1f
some of created objects were missing io.kompose.service label
label added to BuildConfig, DaemonSet, ReplicationController, Deployment and Pod
2017-05-16 17:56:32 +02:00
Suraj Narwade
8fc262bd99 Add build_args support in buildconfig
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
2017-05-16 12:19:00 +05:30
Charlie Drage
f0c4addbaf Use old git command
Some versions of git don't have git-url (case in point on Debian 8, no
get-url on packaged git).

Use old command in getting URL.
2017-05-09 08:55:55 -04:00
Suraj Narwade
aacde86eb9 Fixes fixture test for build context
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.
2017-05-08 17:54:24 +05:30
Suraj Narwade
1eb162d697 Updated Vendoring 2017-04-27 21:38:38 +05:30
Suraj Narwade
605d643a84 Adding code for consistent build context
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.
2017-04-27 21:38:38 +05:30
Tuna
65c9cf9bd8 Merge pull request #557 from procrypt/driver_local
fix driver:local in prefixing volumes with current dir name
2017-04-27 15:25:50 +07:00
Abhishek
7eccb37c19 fix driver:local in prefixing volumes
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.
2017-04-26 20:14:22 +05:30
Abhishek
ec85012a8c typo in nginx name 2017-04-25 11:14:35 +05:30
Charlie Drage
0464d24b40 Merge pull request #511 from kadel/fix-ingress-down
add missing 'io.kompose.service' label to Route and Ingress
2017-04-12 11:47:17 -04:00
Charlie Drage
ee44a2630f Move docker-compose.yml test file to tests
Moves a file that was incorrectly being used from examples to
script/test/fixtures.
2017-04-04 09:09:12 -04:00
Suraj Narwade
df014bebd6 Fixed functional tests
Fixes #431

fixed commands where output showing `command not found` and k8s output
added for restart-options example.
2017-03-30 15:06:57 +05:30
Tomas Kral
f8da61436e
add missing 'io.kompose.service' label to Route and Ingress
This was caussing 'kompose down' not to delete Route and Ingress
2017-03-24 14:42:53 +01:00
Abhishek
55ad1d9b1f delete objects based on label
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.
2017-03-24 00:31:33 +05:30
Charlie Drage
858314e06b Adds mem_limit support for conversion
This commit adds mem_limit support. Taking the value from
docker-compose.yaml and converting it to it's associative value in
Kubernetes artifacts.

Closes (half) of
https://github.com/kubernetes-incubator/kompose/issues/267
2017-02-22 08:19:27 -05:00
Shubham Minglani
b73efa54f2 set strategy to Recreate if vols, add tests,docs
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
2017-02-20 11:44:43 +05:30
Charlie Drage
438088f37d Add support for host:port:port
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
2017-02-09 12:21:17 -05:00
Charlie Drage
cb6c9e9755 Removes the TCP output on the Kubernetes / OpenShift artifacts
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
2017-02-01 13:33:49 -05:00
Charlie Drage
8bf06407ba Merge pull request #368 from procrypt/yaml_and_yml
added support for docker-compose.yaml besides docker-compose.yml
2017-01-30 09:21:33 -05:00
Abhishek
1ecd32a362 error out if controller object is specified with "restart: on-failure" 2017-01-30 17:52:36 +05:30
Tomas Kral
90febe7f7f
Change warning to debug for services without ports. 2017-01-25 13:20:40 +01:00
Tomas Kral
5a62864ef9
Handle Headless Services for OpenShift 2017-01-25 11:28:29 +01:00
sebgoa
3193ac3bd7
Handle Headless Services when no ports are present 2017-01-25 11:28:29 +01:00
Abhishek
96a0572f50 added support for docker-compose.yaml besides docker-compose.yml 2017-01-23 13:30:33 +05:30
Charlie Drage
bf6085dd02 Merge pull request #356 from cdrage/update-vendoring
Update vendoring as well as libcompose
2017-01-12 12:49:14 -05:00
Charlie Drage
15b482698a Uncomment test case for image handling 2017-01-12 08:14:41 -05:00
Suraj Deshmukh
26e348e731 Fixing functional tests for checking generated artifacts
Earlier any test written after check_file_exist would
fail, so fixed it with new function.
2017-01-06 00:35:00 +05:30
Abhishek
cfcbfa8c6d make default kompose conversion YAML 2017-01-04 12:50:56 +05:30
Abhishek
a5a3805760 added support for multiple-compose files 2017-01-03 17:18:34 +05:30
Ratnadeep Debnath
eb719f85c2 Fix tests for buildconfig support. 2016-12-28 17:00:33 +05:30
Ratnadeep Debnath
bea50b1608 Fix tests for buildconfig. 2016-12-28 17:00:33 +05:30
Shubham Minglani
6a151c6267 add stdin_open, tty support, add tests, fix #344
This adds supports for stdin_open: bool and
tty: bool support for kubernetes and openshift
providers in kompose. This maps to the
template.Spec.Containers[0].Stdin and
template.Spec.Containers[0].TTY in Kubernets
world.

Also, added tests.

Fixes #344
2016-12-28 15:58:45 +05:30
Shubham Minglani
7e378cd546 implement expose service, add tests, fix #140
Implements a kompose specific docker compose label "kompose.service.expose" which can be used to expose the specified services externally. The accepted values are of type string.
If the value is set to "true", the provider sets the endpoint automatically, and for any other value, the value is set as the hostname. If multiple ports are defined in a service, the first one is chosen to be the exposed.

Unit tests, functional tests, glide updates and docs have also been added in this commit for the related feature.
2016-12-21 20:00:38 +05:30
Suraj Deshmukh
48e3ba88cd Merge pull request #324 from rtnpro/unsupported-keys-per-provider
Unsupported keys per provider
2016-12-21 19:08:42 +05:30
Shubham Minglani
365fe81987 implement storing to dir/file, add tests
When kompose convert -o artifacts is run, then if artifacts is a directory,
kompose stores all the resulting files inside it, and if it's not a directory,
it stores the artifacts in a single file.

Fixes #209
2016-12-21 18:12:43 +05:30
Tomas Kral
841141ad64 Fix functional tests for unsupported keys 2016-12-20 12:21:53 +05:30
Tuna
a881f5cca0 add test for key-only env 2016-12-19 11:23:42 +01:00
Suraj Deshmukh
6ea5f72e40 support for raw pod output
if a user specifies a docker-compose service
with restart value as "no" or "on-failure"
then normal pod will be created as against
to a controller and a pod.
2016-12-13 19:24:25 +05:30
Suraj Deshmukh
b99d5d9bbe Added volume to mariadb in etherpad fixture
Volume constraint is missing in mariadb service
in etherpad example, so added that so that it mariadb container
does not fail in environments where creating container in
/var/lib/mysql is not allowed for non-root process.
2016-11-17 13:02:49 +05:30
sebgoa
00331589a3 Fix license headers, This closes #223 2016-11-01 15:01:27 +01:00
Christopher A. Baumbauer
1b3f71c55f Add tests converting dab files 2016-10-26 21:47:51 -07:00
Tomas Kral
414645d73c Merge pull request #211 from procrypt/unknown_args
remove unknown args and added tests
2016-10-26 14:37:08 +02:00
Suraj Deshmukh
b068c5cf81 Merge pull request #190 from surajssd/support-volumes-from
support for volumes_from docker-compose construct
2016-10-23 21:40:14 +05:30
Abhishek
1c3092150f remove unknown args and added tests 2016-10-21 12:08:09 +05:30
Tuna
07f1635918 add test 2016-10-20 22:38:16 +02:00
Suraj Deshmukh
fd09efed43 support for volumes_from docker-compose construct
Now a user can provide volumes_from to share volumes
from other service so here the PVC created for that
service will be shared by service calling volumes_from
2016-10-19 09:15:47 +05:30
Tuna
2d09b9567e update test properly.
include --provider=openshift to volume test case.
2016-10-06 23:49:54 +02:00
Tuna
12d6e87454 Merge pull request #186 from surajssd/create-pvc
Create PVC object for docker-compose volumes
2016-10-06 21:39:21 +02:00
Suraj Deshmukh
e879164c2e Create PVC object for docker-compose volumes
Instead of creating emptydir, create PersistentVolumeClaim
for docker-compose volumes by default

Fixes #150
2016-10-06 17:58:17 +05:30
Suraj Deshmukh
b969f7aa44 --provider global flag for kompose
Now a user can select a provider using global flag
--provider=openshift to select openshift provider
or --provider-kubernetes to select kubernetes provider
if nothing is provided kubernetes is the default provider.

Fixes #179
2016-10-06 09:37:54 +05:30
Tomas Kral
04ce10ffea
Update tests - add ImageStreams 2016-09-27 10:28:23 +02:00
Tomas Kral
371af623af
Add test for ports with protocols. 2016-09-19 14:36:23 +02:00
Tuna
338520fb75 rebase master, update tests 2016-09-06 22:48:11 +07:00
Tuna
a9cafc32d5 update tests properly 2016-09-06 22:36:13 +07:00
Tomas Kral
e127ce17bd
test for entrypoint and command 2016-09-05 10:40:50 +02:00
Suraj Deshmukh
36aa6d8c3b Fix output comparison for cmd tests
Now check on true as comparison output, then PASS,
if anything else just fail on it. This avoids all the
false positives.
2016-08-17 22:09:15 +05:30
Janet Kuo
c18288a023 Add more unit tests for Transform 2016-08-16 10:43:44 -07:00
Suraj Deshmukh
b8ea2053e6 Update tests output files
With the recent changes in the output format as List,
updated tests as well so they validate on the new format of output.
2016-08-12 04:42:06 +00:00
Suraj Deshmukh
9a4e953555 Functional Testing
Shell scripts to test k8s and os conversion
which can be ran by following command in root dir
`./script/test/cmd/tests.sh`
2016-08-08 04:39:10 +00:00