Commit Graph

34 Commits

Author SHA1 Message Date
AhmedGrati
0be4868914
Fix expose conversion (#1696)
* fix: remove hostport from expose conversion

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

* test: update unit tests

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

---------

Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>
2023-08-28 08:55:00 -04: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
ichx
8cb1b0599e
Add support for placement preferences docker-compose v3.3+ (#1425) 2021-11-04 08:28:45 +08:00
ichx
d55071e9d6
Support tcp/http liveness/readiness probe (#1449) 2021-11-03 23:30:38 +08:00
ichx
2f081075a8
Fix misuse in struct kobject.ServiceConfig.Port (#1423) 2021-08-29 21:37:22 +08:00
ichx
e82fe96c38
Add support for negated placement constraint (#1419) 2021-08-27 22:49:55 +08:00
exokortex
c51d59566b
actually use normalizeNetworkNames to produce valid network names (#1393) 2021-07-07 14:29:03 +08:00
james song
0b331d9e5d
Fixed, #1385 (#1386)
Add support for more readiness args
2021-05-19 23:52:33 +08:00
Rémy Léone
395d99fb7d
add support for golangci-lint (#1373) 2021-04-07 11:10:56 +08:00
namusyaka
01f18cb3cf
improve tests for loadV3Ports (#1349)
* improve tests for loadV3Ports

* fix a wrong test by passing "expose" appropriately
2020-11-06 11:46:18 +08:00
namusyaka
8b06045c70
Support port range for docker-compose v2 (#1345)
* allow port range specification in v1v2

* improve tests for loadPorts

* add port range to fixtures of docker-compose v2

* update fixtures to follow up on #1341
2020-11-04 22:16:33 +08:00
Hang Yan
ee3228cb7a
Bump docker version (#1334)
to support compose 3.8
2020-10-31 17:30:28 +08:00
Hang Yan
525b68f027
Go mod (#1305)
* Use go mod instead of glide
* Add `--with-kompose-annotation` flag to allow us to switch it off for tests
* Remove hostpid support (since the newest sdk does not support it)
* Create new test script and fixtures
* Remove replicationcontroller support
2020-08-07 17:25:52 +08:00
windayski
42fd5ede3e
fix typo (#1281) 2020-06-18 08:40:29 -04:00
Hang Yan
1089a26844
Support port expose (#1227) 2020-01-04 14:15:10 +08:00
Mudit Verma
ac2b852955 Network Key Translation Feature and test cases (#1195) 2019-12-01 10:19:23 +08:00
Hang Yan
fb7a92ca5e Fix placement parser panic (#1121) 2019-04-04 15:31:06 -04:00
João Vitor Paes de Barros do Carmo
e9dab2781a Unit Test added to Placement Constraints Custom Labels 2018-07-04 17:35:56 -04:00
Hang Yan
88b8e316b9 Support hostname and domainname 2018-03-31 12:00:37 +08: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
Suraj Narwade
f51a7d096e Fixed go vet
Fixes #825 (since `go vet` was failing locally while doing `make test`)
2017-09-26 16:59:13 +05:30
Charlie Drage
2e99b8fd3a Adds healthcheck
This PR adds support for HealthCheck, being able to supply, for example:

```yaml
version: "3"

services:
  redis:
    image: redis
    healthcheck:
      test: echo "hello world"
      interval: 10s
      timeout: 1s
      retries: 5
```

Which is then converted to:

```yaml
spec:
  containers:
  - image: redis
    livenessProbe:
      exec:
        command:
        - echo "hello world"
      failureThreshold: 5
      periodSeconds: 10
      timeoutSeconds: 1
    name: redis
    resources: {}
  restartPolicy: Always
```

At the moment, this only supports livenessProbe, with support for readinessProbe in the future.
2017-08-25 10:02:51 -04: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
Abhishek
1401a39cbd Changing printf verb %s to %v in compose_test.go 2017-06-20 09:58:22 +05:30
Suraj Narwade
209cda28d2 Failing when port is specified with labels
Resolves #522
Kompose will give FATAL error if labels are given but ports are not defined
2017-06-15 09:30:01 +05:30
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
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
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
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
Tomas Kral
3419ae7fe1 few updates based on review 2016-12-20 16:58:28 +05:30
Tomas Kral
d5d0a3f03a Add tests for unsupported keys in loaders 2016-12-20 16:58:23 +05:30
Tuna
7556f6f9fa add unit test for loadEnvVar 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