Commit Graph

43 Commits

Author SHA1 Message Date
Tomer Zait
92ca12ae5b
fix issue https://github.com/kubernetes/kompose/issues/1683 (#1684)
* fix issue https://github.com/kubernetes/kompose/issues/1683

* add tests, die if inputfiles not specified

* fix GetComposeFileDir function and use it

* use fixed GetComposeFileDir instead of filepath.Dir

* return error instead of fatal

* add pod configmap creation to openshift
2024-01-02 14:48:59 -05:00
Charlie Drage
c0e0393bbd
bug: fixes bug with error out with using kompose convert with no -f (#1725)
#### What type of PR is this?

<!--
Add one of the following kinds:
/kind cleanup
/kind documentation
/kind feature
-->

/kind bug

Fixes a validation bug where if you do not provide a compose.yaml or
docker-compose.yaml it will nil point error out rather than have an
appropriate "file not found" output.

#### Which issue(s) this PR fixes:
<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->

Closes https://github.com/kubernetes/kompose/issues/1719

#### Special notes for your reviewer:

Signed-off-by: Charlie Drage <charlie@charliedrage.com>
2023-10-06 13:34:44 -04:00
axel7083
a7c63a650c Adding support for --profile cmd option 2023-09-17 17:41:05 +02:00
AhmedGrati
ea80734f91
Feat: add kompose client PoC (#1593)
* fix: support host port and protocol in functional tests

* feat: add kompose client with options

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

* test: add options unit tests

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

* feat: add partial convert options

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

* feat: finish convert process

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

* test: finish unit tests of the kompose client

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

* remove unecessary changes

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

* feat: add generate network policies to client

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

* update go mod

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

---------

Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>
2023-08-24 11:38:21 +01:00
AhmedGrati
b6b708b637
Feat add ns generation (#1667)
* feat: add ns generation for k8s

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

* feat: add ns generation for openshift

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

* test: add functional tests

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

* fix: remove some code nits

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

---------

Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>
2023-07-16 22:59:16 +01:00
AhmedGrati
c2a020eb13
Feat support compose files (#1595)
* fix: support host port and protocol in functional tests

* feat: support compose.yaml and compose.yml files

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

* test: implement functional tests of the support of compose files

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

---------

Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>
2023-04-05 23:29:08 +01:00
Shivam Sandbhor
1c4ff96626
Infer storage type using label (#1456)
Signed-off-by: Shivam Sandbhor <shivam.sandbhor@gmail.com>
2021-11-13 20:33:10 +08:00
Shivam Sandbhor
41cd3108d9
Remove code for parsing DAB files (#1435)
* Remove code for parsing DAB files

Signed-off-by: Shivam Sandbhor <shivam.sandbhor@gmail.com>
2021-10-01 19:16:09 +08:00
Shuyang Wu
0262c1606c
chore: update error for wrong volume type 2021-08-04 18:33:15 -04:00
Rémy Léone
395d99fb7d
add support for golangci-lint (#1373) 2021-04-07 11:10:56 +08:00
Hang Yan
122384b9f0
Support podman compose file (#1335) 2020-11-01 21:32:25 +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
Hang Yan
47e6015f50
Remove up and down cmd (#1297)
* Remove up and down cmd
2020-08-01 16:01:34 +08:00
Hang Yan
34b827c97e
Support use configmap as volume (#1216) 2019-12-28 01:02:27 +08:00
Haoyun
fd0aad152f
Typo fix
Change validated -> validates at line  159
```release-note
None
```
2018-04-17 11:49:54 +08:00
Hang Yan
505cb8b754 Fix golint warnings 2018-03-25 16:22:08 +08:00
Hang Yan
cf833c8818 Support hostpath volume 2018-03-16 10:40:25 +08:00
Hang Yan
1df73c4004 Refactor package app to use const rather than raw string 2018-02-08 19:43:57 +08:00
Hang Yan
be96662d11 Fix log format error 2018-02-07 13:42:06 +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
4f8babd623 Added --controller feature
Previously we used to mention controller type as `--deployment`,
`--replication-controller` or `--daemonset` as argument.
But now,
it will be like,

ex.

```
kompose convert --controller=daemonset
```
2017-10-04 12:43:45 +05:30
Suraj Narwade
269f604094 Fixed --volumes validation
Now, `--volumes` argument will validate it's input, it will only allow
`persistentVolumeClaim` or `emptyDir`, otherwise it will throw an error.
2017-09-25 17:25:57 +05:30
Charlie Drage
796313f626 Merge pull request #704 from cdrage/graduate-from-incubator
kubernetes-incubator -> kubernetes
2017-07-12 16:49:55 -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
Shubham Minglani
0a9e2a7885 remove unused parameter from ValidateComposeFile()
In pkg/app/app.go, the function ValidateComposeFile() has an
unused parameter "cmd *cobra.Command".

This commit removes that parameter from the function and the
callers of the function.
2017-07-12 14:45:52 +05:30
Charlie Drage
ce32bb817d 2016 -> 2017 for licensing
New year, update to the license.
2017-06-28 10:49:52 -04:00
Charlie Drage
b8a46895a6 Disable DAB
See issue: https://github.com/kubernetes-incubator/kompose/issues/390

Disable DAB as it is hard to maintain / not much usage / DAB is still
experimental in Docker and there hasn't been much movement:
https://github.com/moby/moby/issues/26876

MarkDeprecated does not work at the moment due to issue:
https://github.com/kubernetes-incubator/kompose/issues/652

However, that is not a blocker as we `fatalF` within `ValidateFlags`
2017-06-20 09:02:53 -04:00
Charlie Drage
27fc70aa52 Merge pull request #536 from kadel/pr477-angain-and-better
new take on "Kompose will keep trying its job #477"
2017-04-10 12:29:41 -04:00
Suraj Narwade
3a086b4f2f Removed unused functions
Fixes #534 by removing functions askForConfirmation in app.go, TransformData and RandStringBytes in utils.go
2017-04-04 11:24:35 +05:30
Suraj Narwade
da6a2e946a
Kompose will keep trying its job
fixes #270

all errors in undeploy method(both kubernetes and openshift) are appended in a slice of errors,
and then it will be returned after successful deletion of all components.
2017-04-03 18:19:06 +02:00
Charlie Drage
8e0de50d38 Revert "Kompose will keep trying its job" 2017-04-03 11:52:01 -04:00
Suraj Narwade
80b15c1d95 Kompose will keep trying its job
fixes #270

all errors in undeploy method(both kubernetes and openshift) are appended in a slice of errors,
and then it will be returned after successful deletion of all components.
2017-03-31 14:14:14 +05:30
Shubham Minglani
e9544ca894 add github.com/pkg/errors to glide and vendor
This adds github.com/pkg/errors to glide.yaml followed
by glide and glide-vc commands. The github.com/pkg/errors
package is currently required mainly for the errors.Wrap()
and errors.New() methods, since this lets us to annotate the
errors while passing the error message up the call stack.
2017-03-15 19:41:28 +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
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
Abhishek
96a0572f50 added support for docker-compose.yaml besides docker-compose.yml 2017-01-23 13:30:33 +05:30
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
6f3e670af1 Refactor openshift buildconfig CLI options.
- Remove --buildconfig, -bc option. Create buildconfig if service has build info
- Rename --branch to --build-branch
- Rename --repo to --build-repo
2016-12-28 17:00:33 +05:30
Ratnadeep Debnath
92b6678d1b Initial implementation of BuildConfig support for Openshift provider. 2016-12-28 17:00:32 +05:30
Charlie Drage
1b9228e696 Switch to spf13/cobra from urfave/cli
There's A LOT happening in this commit, so here's an outline:

First off, urfave/cli has been removed in favour of spf13/cobra. With
this, comes changes to the formatting as well as the help page for
Kompose.

Upon converting, I noticed a CLI flag was NOT appearing for OpenShift.
Specifically, --deploymentconfig. This has been added with a note
that says it is OpenShift only.

Exit codes have been fixed. If the conversion / down / up fails for
any reason, Kompose will exit with Code 1.

--verbose as well as --suppress-warnings can now be set at the
same time.

app_test.go in the cli directory has been moved to pkg/transformer
to better reflect the testing coverage.

version.go has been removed and converted to it's own CLI command in
conjuction with (most) Go software. A new CLI command has been
created. kompose version

--dab isn't a conventional way for short-form CLI paramters. This
has been shortened to -b for bundle.

CLI flags consisting of only two/three letters have been removed due to
it being unconventional for CLI. For example, --dc was removed in preference
for --deploymentconfig

--replicas has been added as an option when using kompose down or
kompose up. This has been added as previously in app.go the
replica amount was hard-coded as 1.

Differentiating names have been used for flags. For example,
persistent flags use the name Global (ex. GlobalOut). Command-specific
flags have their own names (ex. UpOpt).

Closes #239 #253
2016-12-22 08:15:51 -05:00