Commit Graph

44 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
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
529e6c674f sort output when creating kubernetes/openshift objects 2017-05-09 23:56:54 +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
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
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
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
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
Tomas Kral
90febe7f7f
Change warning to debug for services without ports. 2017-01-25 13:20:40 +01:00
Tomas Kral
8f2dd5b03b
Test Headless Services 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
Tomas Kral
3cf6866dd0
Small simplification of kubernetes.PrintList
Use reflect instead of big type switch that was prone to errors.
2017-01-06 15:22:37 +01:00
Tomas Kral
4f176b847e
fix golint errors 2017-01-05 10:31:11 +01:00
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
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
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
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
Tomas Kral
5a94a9fdbc
Add support for user 2016-11-25 09:50:51 +01:00
Tomas Kral
8bb89876cf
Clean up scripts/validate-*. Add vet,gofmt,lint tests.
Travis now runs `make validate` as first test.
Make validate includes all validate tests (go vet, gofmt)
2016-11-22 13:02:13 +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
Dusty Mabe
c5e07f4926
transformers: make Openshift Inherit from Kubernetes 2016-10-27 11:48:24 -04:00
Tomas Kral
1280b9abcb Merge pull request #189 from procrypt/labels
Configure service types
2016-10-27 12:25:29 +02:00
Abhishek
841d28192f configure service types 2016-10-21 04:02:15 +05:30
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
1f8a0e06c9
Upgrade OpenShift and its dependencies.
OpenShift version 1.4.0-alpha.0
2016-10-18 12:04:00 +02:00
Tomas Kral
f8f737be7b
move to kubernetes-incubator
update imports to reflect move to kubernetes-incubator
2016-10-17 18:14:29 +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
Tomas Kral
6f1d01a809
OpenShift - generate DeploymentConfig with ImageStream. 2016-09-27 10:28:11 +02:00
Tomas Kral
b2add4163f Merge pull request #127 from kadel/entrypoint
docker-compose - Entrypoint support
2016-09-05 10:50:20 +02: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
Tomas Kral
e2da0f089a
Make sure that Services are first in the List
Sorts objects in Transform function, this should
make sure that Services are first everywhere as
long as we keep order in the slice that Transform returns.

fixes #130
2016-09-02 10:09:00 +02:00
Tomas Kral
b24556e9d5
fixes #124
add missing conversion to versioned object when saving to files
2016-09-02 09:49:11 +02:00
Tuna
82ae7fab78 clean code 2016-08-25 00:34:54 +07:00
Tuna
4f36dca026 fix #121: update all objects, even when port is missing 2016-08-24 00:07:38 +07:00
Suraj Deshmukh
163a06df27 Create service function in kubernetes utils
This function can be used in both openshift and kubernetes and all the logic
of creating service can be kept in this function.
2016-08-17 09:54:17 +05:30
Suraj Deshmukh
c281bfdda8 Abstracted port checking function
To reduce the inconsistency of message printing created a
function which can be called from both kubernetes and openshift
2016-08-16 14:28:14 +05:30
Tuna
baedd92036 move k8s base functions into k8s package 2016-08-12 00:46:03 +07:00
Tuna
f10d6afecf make loader, transformer as interfaces 2016-08-11 23:33:45 +07:00