Commit Graph

18 Commits

Author SHA1 Message Date
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
Suraj Narwade
af43de2c2e Moved cpu_shares and cpuset to unsupported keys
Resolves #272 and #267

As there is no direct mapping of `cpushares` and `cpuset` to kubernetes,
it should not be read and should be moved to unsupported keys.
2017-04-05 22:46:57 +05:30
Suraj Narwade
ec897ef50f Added dockerfile key support
Fixes #486
This commit will add `dockerfilepath` key under Dockerstratergy in buildconfig.
dockerfilepath allow us to use dockerfiles which are named different than `Dockerfile` which are placed in context directory.

for example, for a docker-compose file:

```
version: "2"
services:
    foo:
        build:
            context: "./build"
            dockerfile: "Dockerfile-alternate"
        command: "sleep 3600"
```
Resulting buildconfig will be:

```
apiVersion: v1
kind: BuildConfig
...
...
  strategy:
    dockerStrategy:
      dockerfilePath: Dockerfile-alternate
    type: Docker
...
...
```
2017-03-22 17:49:26 +05:30
Shubham Minglani
5cb598fa5b return errors instead of logrus.Fatal calls
This commit refactors the code to remove more or less
all occurences of logrus.Fatalf() from the code under
pkg/ except for app.go where all the errors are being
handled currently.

This is being done since random logrus.Fatalf() calls
all around the code was making handling the errors,
unit testing and troubleshooting a bit more painful.

logrus.Fatalf() calls are either replaced by
return errors.New("new error")
or
return errors.Wrap(err, "annonate error")
calls, and the function signatures are accordingly
changed to accomodate the new return values.

The unit tests which previously used to check
if logrus.Fatalf() calls worked fine have also
been fixed to only check for errors now.

Fixes #416
2017-03-15 13:30:21 +05:30
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
Abhishek
7a12a16dc7 Unit test for error out if controller object is specified with restart: on-failure 2017-02-13 12:41:16 +05:30
Tomas Kral
8f2dd5b03b
Test Headless Services 2017-01-25 11:28:29 +01:00
Suraj Deshmukh
d64a441e53 Fixed warnings related to user type in tests
Fixes # 343

Type of user is not string and that's what was being provided
in tests so fixed it and now tests output is cleaner.
2017-01-16 12:07:33 +05:30
Tomas Kral
4f176b847e
fix golint errors 2017-01-05 10:31:11 +01:00
Abhishek
a5a3805760 added support for multiple-compose files 2017-01-03 17:18:34 +05:30
Ratnadeep Debnath
44f94cc072 Fixes/updates based on review. 2016-12-28 17:02:33 +05:30
Ratnadeep Debnath
a753f35d42 Added docs for openshift unit tests. 2016-12-28 17:02:33 +05:30
Ratnadeep Debnath
4ead7156f4 Renamed pkg test to testutils. 2016-12-28 17:02:33 +05:30
Ratnadeep Debnath
c8d8cbbba9 Added unittests for openshift buildconfig integration. 2016-12-28 17:02:32 +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
Charlie Drage
ee2946c810 Fix container_name incorrectly being generated
Checks to see if "container_name" is used correctly in a docker-compose
file conversion and updates the changes respectively in the outputted
artifact files.

For example with container_name set as myfoobarname, the change will
correctly update the "containerNames" portion of the deployment-config
for OpenShift.

"imageChangeParams": {
  "automatic": true,
  "containerNames": [
    "myfoobarname"
  ],
  "from": {
    "kind": "ImageStreamTag",
    "name": "rabbit:3.6.1"
  }
}

Closes https://github.com/kubernetes-incubator/kompose/issues/301
2016-12-08 13:49:11 -05:00