Commit Graph

54 Commits

Author SHA1 Message Date
gitlawr
1485ed4479 add support for "pid" key
solve #610
convert service.pid to Pod.Spec.HostPid
set Pod.Spec.HostPid to true if service.pid ="host", to false otherwise
update conversion.md on support for the key
2017-05-31 22:39:17 +08:00
Charlie Drage
8938fa13f5 Merge pull request #608 from gitlawr/stop_grace_period
Add support for stop_grace_period
2017-05-23 14:42:29 -04:00
gitlawr
c01f6f1763 To solve #440
This commit Add support for stop_grace_period which maps to
Pod.Spec.TerminationGracePeriodSeconds
Updated conversion.md on support for the key
2017-05-23 12:03:14 +08:00
Abhishek Chanda
9ebfa9e293 Replace underscores with dashes while rendering container names
Kubernetes container names must match the regex [a-z0-9]([-a-z0-9]*[a-z0-9])?
This excludes underscores, which is common in container names in compose.
2017-05-17 07:31:33 +00: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
gitlawr
3916eb9f60 Fixes #575
This commit Add support for cap_add & cap_drop which maps to
Pod.Spec.Container.SecurityContext.Capabilities.Add/Drop
Added unit tests for ConfigCapabilities function
Updated conversion.md on support for these keys
2017-04-28 14:41:12 +08: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
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
Abhishek
6e0b934f77 Propagate underscores into valid names
Now we can provide service name with "_" in docker-compose files and they will by converted as "-" in the generated artifacts by kompose eg, if the service name in docker-compose file is "foo_bar" then it will be converted into "foo-bar" in the generated artifacts
2017-04-03 13:06:33 +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
Tomas Kral
fba87faa16 Merge pull request #504 from surajnarwade/minor_fix
Removed Duplicate line(build) from compose.go
2017-03-22 13:08:08 +01:00
Tomas Kral
c0e2d5a271 Merge pull request #494 from cdrage/remove-extend-from-unused
Remove extend from unused keys, add to conversion doc
2017-03-22 12:56:26 +01:00
Suraj Narwade
73d9970197 Removed Duplicate line(build) from compose.go 2017-03-22 13:06:50 +05:30
Suraj Narwade
494133484c Added support for tmpfs
fixes #436
This commit will add support for tmpfs, configEmptyVolumeSource
function is being modified as it have to work in two ways now.
(For emptyvols and tmpfs)
Added unit test for tmpfs too.
2017-03-16 22:14:39 +05:30
Charlie Drage
482c5520c9 Remove extend from unused keys, add to conversion doc
This removes the "unsupported" extends from the list (since we actually
support) as well as add a clarificiation on the conversion.md document.

Closes https://github.com/kubernetes-incubator/kompose/issues/475
Closes https://github.com/kubernetes-incubator/kompose/issues/493
2017-03-15 09:28:58 -04:00
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
Tomas Kral
8b66473edd
Add cap_add and cap_drop to unsupported keys 2017-03-02 14:54:52 +01:00
Abhishek
a539e44d94 unsupported keys 2017-03-02 11:09:31 +05:30
Charlie Drage
c0043ebd11 Clean up logrus
Replaces "log" from "logrus" as commonly used in large Go projects.

Makes it easier from a developer perspective to use `log.Info`,
`log.Debug`, etc.
2017-02-27 10:53:24 -05:00
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
Tomas Kral
fb042c7b20 Merge pull request #428 from surajssd/remove_unnecessary_objects
removed unnecessary objects in compose.go
2017-02-15 11:29:57 +01:00
Suraj Deshmukh
0bc24d5ca6 normalize docker-compose service that has name with underscore
kubernetes or openshift does not allow underscores in the object
names, while docker-compose does, in this commit the code has been
added to convert underscores to hypens.
2017-02-14 17:39:42 +05:30
Suraj Deshmukh
775f5012c9 removed unnecessary objects in compose.go
In compoese.go while iterating on the ServiceConfig objects first
it's keys were pulled and then data was pulled separately which
can be done in one step by iterating on the dictionary.
2017-02-14 08:30:38 +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
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
39fbc4ab9c Update checking to see if a default network has been provided
Due to changes to libcompose, NetworkConfigs now returns a default
network regardless if one has been provided or not.

An if statement is added that will debug output and ignore the default
network provided that it's the only network available.
2017-01-10 09:45:17 -05:00
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
92b6678d1b Initial implementation of BuildConfig support for Openshift provider. 2016-12-28 17:00: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
Tomas Kral
3419ae7fe1 few updates based on review 2016-12-20 16:58:28 +05:30
Tomas Kral
e4f9b59b4d Separate unsupported key check for every loader 2016-12-20 12:21:03 +05:30
Tuna
000ed33cb1 support parse key-only environment variable
fix #303
2016-12-19 11:23:42 +01:00
Suraj Deshmukh
bb9e4fba61 Generic service type handler for kompose
Moved label handling code from Transformer to loader,
to make it generic to handle creating service types.

Added new attribute to ServiceConfig which gets populated
in loader.

Fixes #273
2016-11-16 22:01:01 +05:30
sebgoa
00331589a3 Fix license headers, This closes #223 2016-11-01 15:01:27 +01: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
Tuna
df533a2bd7 choose separator which happens first 2016-10-20 22:13:13 +02:00
Tuna
1fdaffe540 support both : and = as envvar separators 2016-10-20 21:16:43 +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
Tomas Kral
f8f737be7b
move to kubernetes-incubator
update imports to reflect move to kubernetes-incubator
2016-10-17 18:14:29 +02:00
Tuna
592cc95907 upgrade libcompose to fbdac0a6a80837c63eb6c8f43514f7bb3f32df6c 2016-10-09 02:35:51 +02:00
Tomas Kral
ed711804fe
Add port protocol handing for docker-compose. 2016-09-19 14:36:05 +02:00
Tuna
0c33e7e965 Use libcompose project.Context{} instead of docker.Context{}
Fix #134
2016-09-05 23:24:24 +07:00
Tomas Kral
cc4f162cea
Remove Entrypoint from Kompose object
We had Command and Args together with Entrypoint in Kompose object.
This doesn't make much sense, as Entrypoint and Command are same thing.
I've removed Entrypoint from Kompose object in favor of Command to keep
same naming convensions as in Kubernetes.

Entrypoint from docker-compose.yml is now saved to Command and Command
is saved to Args (http://kubernetes.io/docs/user-guide/containers/).

docker-compose.yml | Kompose object
-------------------|---------------
  Entrypoint       |    Command
   Command         |     Args
2016-09-02 10:10:34 +02:00
Tomas Kral
8590a98504
docker-compose - fix Command and add Entrypoint support 2016-09-02 10:10:34 +02:00
Tuna
82ae7fab78 clean code 2016-08-25 00:34:54 +07:00
Janet Kuo
4d0960fea8 Merge pull request #119 from janetkuo/improve-err-message
Improve error message for invalid port
2016-08-23 11:07:08 -07:00
Janet Kuo
332c5b2c35 Improve error message for invalid port 2016-08-22 14:26:23 -07:00