Commit Graph

88 Commits

Author SHA1 Message Date
Tomas Kral
c5fa9f7f2a
Fix incorrect tag in BuildConfig.
For services with build and image keys DeploymentConfig respects tag from docker-compose image key.
But BuildConfig image tag was always set to  'latest'.
Result of this was that deployment wasn't trigired after successful build.
This fixes it by setting BuildConfig output image tag to the same tag that is used for  DeploymentConfig (tag from docker-compose image key)
2017-05-23 14:05:59 +02:00
Tomas Kral
bee784faf6
Use BuildConfig reaper to delete BuildConfig with all related pods 2017-05-16 17:56:38 +02:00
Tomas Kral
792976da1f
some of created objects were missing io.kompose.service label
label added to BuildConfig, DaemonSet, ReplicationController, Deployment and Pod
2017-05-16 17:56:32 +02: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
Suraj Deshmukh
f7a78edeae remove duplicate import with different name
`k8s.io/kubernetes/pkg/api` is imported directly and once with the alias
import name `kapi` so remove the original import and keep the aliased with
`kapi` one and also replace the code bits which call it with `api` name.
2017-05-15 21:12:05 +05:30
Abhishek
529e6c674f sort output when creating kubernetes/openshift objects 2017-05-09 23:56:54 +05:30
Suraj Narwade
605d643a84 Adding code for consistent build context
fixes #445

This PR was partially fixed by docker/libcompose#450, which now gives consistent build context,
also it modifies the function getAbsBuildContext to create accurate build context, Unit test are being modified
according to new structure.
2017-04-27 21:38:38 +05:30
Suraj Narwade
9a6c1d99b3 Added warning after PVC creation
Partially resolve #376 and #345
Added warning, such that PV should be created before PVC or
if dynamic provision is there, no need to create PV.
2017-04-13 14:25:14 +05:30
Charlie Drage
0464d24b40 Merge pull request #511 from kadel/fix-ingress-down
add missing 'io.kompose.service' label to Route and Ingress
2017-04-12 11:47:17 -04:00
Abhishek
f41985a00e Added support for different namespaces
Now we can deploy application in different namespaces using the "--namespace=<value>" flag with kompose up and kompose down. The --namepace flag will deploy the application in that particular "namespace" if exist."
2017-04-12 18:40:32 +05:30
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
qujinping
3919ad25b5 Support insecure registry and enhance parsing of image stream tag 2017-04-07 10:01:46 +08:00
Tomas Kral
d21c240e3e
skip to next object when there is an error with deletion 2017-04-03 18:19:33 +02:00
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
Tomas Kral
f8da61436e
add missing 'io.kompose.service' label to Route and Ingress
This was caussing 'kompose down' not to delete Route and Ingress
2017-03-24 14:42:53 +01:00
Tomas Kral
3c3ae9807a Merge pull request #483 from procrypt/empty_vols
delete objects based on label
2017-03-24 12:11:29 +01:00
Abhishek
55ad1d9b1f delete objects based on label
This PR uses the "SelectorFromSet()" function which takes alabel or
selector as an argument returns all the object that uses that label or
selector. Once we get the object that uses a particular label we can
further do the delete operation on them. This is similar to "kubectl
delete <object> --selector=<key>=<value>". Also the label has been
modified from service to io.kompose.service.
2017-03-24 00:31: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
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
Abhishek
082e2351a0 abstract_out_api.PodSpec 2017-02-22 20:25:55 +05:30
Tomas Kral
7dac1a33d2 Merge pull request #413 from procrypt/add_buildConfig_to_kompose_down
add BuildConfig support to kompose down
2017-02-15 11:15:07 +01:00
Charlie Drage
01bf975185 Fix a small spelling error
s/service/Service/g
2017-02-08 08:55:43 -05:00
Abhishek
846812677d add buildConfig support to kompose down 2017-02-06 17:24:04 +05:30
Abhishek
1ecd32a362 error out if controller object is specified with "restart: on-failure" 2017-01-30 17:52:36 +05:30
Tomas Kral
5a62864ef9
Handle Headless Services for OpenShift 2017-01-25 11:28:29 +01:00
Tuna
5e59400345 deploy/undeploy pod to OpenShift provider 2017-01-10 17:04:22 +01:00
Tomas Kral
4f176b847e
fix golint errors 2017-01-05 10:31:11 +01:00
Abhishek
a5a3805760 added support for multiple-compose files 2017-01-03 17:18:34 +05:30
Ratnadeep Debnath
0d86f3e087 Updated docs for openshift buildconfig feature
- Added buildconfig doc in user guide.
- Add inline code documentation to explain why buildconfig
  object needs to be created after imagestream, because of
  https://github.com/openshift/origin/issues/4518
2016-12-28 19:24:45 +05:30
Ratnadeep Debnath
7c959b65d4 Fixed typos in openshift buildconfig
- spelling mistake
- pass compose file dir instead of compose file to initBuildConfig call
- Use as default value for cli --build-branch option
- Pass current build branch to buildconfig related functions instead of opt.BuildBranch
- Fix printing buildconfig source branch in logs.
2016-12-28 19:23:37 +05:30
Ratnadeep Debnath
b62fb02571 Fix openshift buildconfig info logs
based on review.
2016-12-28 17:02:33 +05:30
Ratnadeep Debnath
ec09ca428b Generate openshift imagestream when build is absent. 2016-12-28 17:02:33 +05:30
Ratnadeep Debnath
f0165d209f In buildconfig, get git's current remote URL instead of current branch's remote. 2016-12-28 17:00:34 +05:30
Ratnadeep Debnath
bbbd4037b4 Update command to fetch current git remote for buildconfig. 2016-12-28 17:00:33 +05:30
Ratnadeep Debnath
a1797a8d07 In buildconfig, detect current branch and it's remote url as defaults. 2016-12-28 17:00:33 +05:30
Ratnadeep Debnath
875c7d95dc Include buildconfigs in kompose deployment. 2016-12-28 17:00:33 +05:30
Ratnadeep Debnath
3b13dae515 Fix govet warning for openshift buildconfig.
Go vet warning was 'composite liternal uses unkeyed fields'.
2016-12-28 17:00:33 +05:30
Ratnadeep Debnath
d8ec3db673 Bugfix in specifying custom build repo for buildconfig. 2016-12-28 17:00:33 +05:30
Ratnadeep Debnath
ba9995c17b Update cmd to get git remote url for backwards compatibility
with older git-2.6.x
2016-12-28 17:00:33 +05:30
Ratnadeep Debnath
e83b454536 Bugfix: Accept abs path for compose file for buildconfig.
Change directory to compose file dir when resolving git remote.
2016-12-28 17:00:33 +05:30
Ratnadeep Debnath
1a7b19c070 Resolve/print buildconfig source repo info globally for compose project. 2016-12-28 17:00:33 +05:30
Ratnadeep Debnath
f5566d4097 Improve error handling and logging for openshift buildconfig creation.
- Error out on failure to create buildconfig, with meaningful error messages, e.g., git missing, error in fetching git remote, error in creating build context, etc.
- Add info log for build repo/branch being used.
2016-12-28 17:00:33 +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
fa724fe12d Allow specifying repo,branch info for buildconfig over CLI. 2016-12-28 17:00:33 +05:30
Ratnadeep Debnath
9e2849addf In Openshift, don't create imagestream tags for a service with build diretive. 2016-12-28 17:00:33 +05:30
Ratnadeep Debnath
6156d144f2 Fix generating project source repo URL in openshift buildconfig. 2016-12-28 17:00:33 +05:30
Ratnadeep Debnath
efc5203d82 Fix creating build context dir relative to project root dir. 2016-12-28 17:00:33 +05:30