Commit Graph

79 Commits

Author SHA1 Message Date
AhmedGrati
8f0a6684ca
Feat support security fsgroup (#1613)
* feat: support security context fsgroup

Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>

* test: add unit test to security group fsgroup

Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>

* test: add functional test to security group fsgroup

Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>

* docs: add documentation of the new label of security group fsgroup

Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>

---------

Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>
2023-04-05 14:11:10 -04:00
AhmedGrati
6be6fdd165 feat: support external traffic policy
Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>
2023-02-13 14:59:46 +01:00
Lctrs
2ad5745d58
feat: migrate from libcompose to compose-go (#1547)
* feat: migrate from libcompose to compose-go

libcompose has been deprecated since summer 2021 in favor of https://github.com/compose-spec/compose-go.
Kompose should now be able to load all versions of compose.

* chore: replace golint with staticcheck

golint has been deprecated. Recommended replacement is staticcheck.
2023-01-12 15:17:22 -05:00
Rémy Léone
395d99fb7d
add support for golangci-lint (#1373) 2021-04-07 11:10:56 +08:00
Hang Yan
ee3228cb7a
Bump docker version (#1334)
to support compose 3.8
2020-10-31 17:30:28 +08:00
Hang Yan
f31257f5cf
Add support for compose 2.x (#1333) 2020-10-31 08:27:50 +08:00
Mudit Verma
ac2b852955 Network Key Translation Feature and test cases (#1195) 2019-12-01 10:19:23 +08:00
sivanzcw
d03a6a9474 fix golint error about comment on exported variable (#1178) 2019-11-14 11:38:48 +08:00
Hang Yan
06468b2f63 Update dep for compose 3.5+ (#1120)
* Update vendor packages

* Support compose 3.5+ versions
2019-03-26 11:44:26 -04:00
Hang Yan
a012fba1c2 Support read data from stdin 2018-08-09 22:46:41 +08:00
Xianlu Bird
0252213efb Add support for Config, endpoint_mode and 3.3 support (#994)
* Add support for Config

* Add deployment endpoint_mode support

* Add docker compose 3.3 support

* Add compose v3.3 support for openshift
2018-08-01 15:09:00 -04:00
Hang Yan
5a374742cf
Merge pull request #871 from surajnarwade/stdin
Kompose will read input from stdin
2018-06-06 22:20:27 +08:00
Tomas Kral
25f8ba42f9
Merge pull request #976 from hangyan/hostname-domain-support
Support hostname and domainname
2018-04-11 15:58:18 +02:00
Hang Yan
3c531fea66 Fix typos in comments 2018-04-01 16:01:51 +08:00
Hang Yan
88b8e316b9 Support hostname and domainname 2018-03-31 12:00:37 +08:00
Hang Yan
61ff9eeeaa Add support for compose v3.2 2018-03-09 00:13:10 +08:00
Suraj Narwade
6d4c8f9b78 Kompose will read input from stdin
Resolves issue #870

for example,

```
$ cat docker-compose.yaml | kompose convert -f -
INFO Kubernetes file "frontend-service.yaml" created
INFO Kubernetes file "redis-master-service.yaml" created
INFO Kubernetes file "redis-slave-service.yaml" created
INFO Kubernetes file "frontend-deployment.yaml" created
INFO Kubernetes file "redis-master-deployment.yaml" created
INFO Kubernetes file "redis-slave-deployment.yaml" created
```

Added integration test for the same.
`
2018-03-07 12:49:21 +05:30
Charlie Drage
84be7400a2
Merge pull request #846 from surajnarwade/buildv3
Added support for build key in v3
2017-11-30 09:06:32 -05:00
Suraj Narwade
5de4aa85f8 Added sirupsen and updated all occurances
Updated `sirupsen`, `docker/cli`, `docker/libcompose` in `glide`,
Also changed `Sirupsen` with `sirupsen` in all kompose packages as well as in
`docker/distribution` packages
2017-11-27 12:28:46 +05:30
xianlubird
9b66188144 Ignore links attribute and print warning message
Signed-off-by: xianlubird@gmail.com
2017-11-08 10:08:12 +08:00
Charlie Drage
787b7d9261 kubernetes-incubator -> kubernetes
Today, we graduate from the incubator, thus all links are updates from
kubernetes-incubator to kubernetes
2017-07-12 15:42:13 -04:00
Charlie Drage
ce32bb817d 2016 -> 2017 for licensing
New year, update to the license.
2017-06-28 10:49:52 -04: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
Charlie Drage
1f0cf0b2e1 Merge pull request #609 from surajnarwade/validate_dockerfilepath
Validate dockerfilepath in buildconfig
2017-05-31 13:13:04 -04:00
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
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
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