* 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.
* 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
* 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
Updated `sirupsen`, `docker/cli`, `docker/libcompose` in `glide`,
Also changed `Sirupsen` with `sirupsen` in all kompose packages as well as in
`docker/distribution` packages
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.
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.
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
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.
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
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