366 Commits

Author SHA1 Message Date
Suraj Narwade
bbcf73f7a9 Add support for creating component from service catalog (#413)
* Add support for creating component from service catalog

Fixes #266

Signed-off-by: Suraj Narwade <surajnarwade353@gmail.com>

This PR adds the support for creating services from service catalog. for this support, we have used
client from [kubernetes-incubator/service-catalog](https://github.com/kubernetes-incubator/service-catalog).
Currently, we are supporting template service broker only. In future, we will add support for
other brokers as well.

We have added entire new command set for this purpose.

* to check available services in service catalog

```
$ odo service catalog
```

* to create service,

```
$ odo service create mysql-persistent
```

* to delete service,

```
$ odo service delete mysql-persistent
```

* to list the current provisioned services with their status

```
$ odo service list
```

* updated component/service search in catalog

* remove commented code from service.go

* removed hard coded template-service-broker
2018-08-29 20:19:34 +05:30
Suraj Narwade
2f60a7206b v0.0.10 (#662) 2018-08-24 19:10:08 +05:30
Suraj Narwade
1a7dfd97a1 v0.10.0 (#661) 2018-08-24 19:03:05 +05:30
anmolbabu
573ea65bea Enable levelled logging (#590)
* Enable logging as per verbosity rules in odo

Ref: https://kubernetes.io/docs/reference/kubectl/cheatsheet/#kubectl-output-verbosity-and-debugging
To accomplish the above, in this PR as suggested by #189 (comment), the
following will be done:
1. replace log "github.com/sirupsen/logrus" with "github.com/golang/glog"
2. replace log.Debugf with glog.V(4).Infof
3. replace log.Errorf with glog.Errorf

fixes #189
Signed-off-by: anmolbabu <anmolbudugutta@gmail.com>

* Update vendor to use glog instead of logrus

fixes #189
Signed-off-by: anmolbabu <anmolbudugutta@gmail.com>

* Fix gofmt errors

fixes #189
Signed-off-by: anmolbabu <anmolbudugutta@gmail.com>

* Incoporate @snarwade comments

fixes #189
Signed-off-by: anmolbabu <anmolbudugutta@gmail.com>

* Rebase

Signed-off-by: anmolbabu <anmolbudugutta@gmail.com>

* Incoporate @kadel comments

fixes #189
Signed-off-by: anmolbabu <anmolbudugutta@gmail.com>
2018-08-24 13:22:02 +05:30
Charlie Drage
7965a83cad Merge pull request #568 from piyush1594/iss_507
Add odo storage list --all command feature
2018-08-23 11:07:28 -04:00
Piyush Garg
8f14e3ebfe Changes the order of component name and application name 2018-08-23 16:10:50 +05:30
Piyush Garg
bc18ec7e36 Add odo storage list --all command feature
This will list all the storages in all the components in a
current application and project
Syntax will be odo storage list --all
on execution of odo storage list --all componentName it will fail

Fixes #507

Add e2e test related to feature

Refactored the output format for --all flag

Add comments about code flow

Fix semicolon comment

Fix issue of unmounted storage getting printed multiple times

Add function for listing mounted storage and unmounted storage

Add spacing before lines

Add a flag in unmount function

Basically in case of deleting pvc, we are first unmounting
and then deleting. Then unmounting function is updating the labels
So if we are deleting the pvc then updating call is not required
Added a flag to update Labels or not, when delete function is called
its set to false and when unmount is called it is set to true

Add comments about updateLabels

Made the code resuable and more simpler

Address other indentation and format changes

Make print format look good
2018-08-20 22:42:49 +05:30
Tomas Kral
ca8e27f83d Merge pull request #649 from anmolbabu/fixes#645
Fix the odo component creation documentation
2018-08-20 10:59:07 +02:00
Tomas Kral
a1860c4bd0 Merge pull request #615 from mik-dass/url_port
Added the port flag to the URL create command.
2018-08-20 09:32:56 +02:00
anmolbabu
08e37eb550 Fix the odo component creation documentation
The odo create command documentation suggests usage of
odo component list instead of odo catalog list. This PR
fixes the same.

fixes #645
Signed-off-by: anmolbabu <anmolbudugutta@gmail.com>
2018-08-18 22:04:49 +05:30
mdas
a2a07a9e18 Changed the type of URL Port from intstr.IntOrString to int and added better comments and error messages
Signed-off-by: mdas <mrinald7@gmail.com>
2018-08-17 20:25:53 +05:30
mdas
3334a1df11 Moved url port number validation to Create() function in pkg/url/url.go and modified unit tests and e2e tests accordingly.
Signed-off-by: mdas <mrinald7@gmail.com>
2018-08-16 20:37:31 +05:30
Tomas Kral
11084d192e rename '--ports' flag for 'odo create' to singular '--port' 2018-08-16 10:49:14 +02:00
Suraj Narwade
6894d085e4 Validate storage path
This PR will add functionality to validate storage path before creating storage (internally PVC)
Resolves #505
2018-08-10 18:17:48 +05:30
mdas
7c24d37c46 Added the automatic detection of port if the port flag is set for URL create command incase of components which expose a single port service.Incase of components which expose a two port service, the port flag is required.
Signed-off-by: mdas <mrinald7@gmail.com>
2018-08-10 14:56:41 +05:30
mdas
0bf45613d2 Added examples for the URL create command 2018-08-09 14:37:53 +05:30
mdas
0ba3aaea6c Added the port flag to the URL create command. The 'odo url list' was modified to display the port of the url and the display format was changed to a more tabular form.
Added function GetComponentServicePortNumbers to pkg/url package to expose the routes exposed by the service.

Signed-off-by: mdas <mrinald7@gmail.com>
2018-08-09 14:37:53 +05:30
anmolbabu
95b12dc79b Incoporate comments by @snarwade
fixes #608
Signed-off-by: anmolbabu <anmolbudugutta@gmail.com>
2018-08-08 18:16:04 +05:30
anmolbabu
b9b8e4f605 Incoporate @cdrage comments
fixes #608
Signed-off-by: anmolbabu <anmolbudugutta@gmail.com>
2018-08-08 18:16:03 +05:30
anmolbabu
19d8085cef Incorporate @tkral comments
fixes #608
Signed-off-by: anmolbabu <anmolbudugutta@gmail.com>
2018-08-08 18:16:03 +05:30
anmolbabu
56d7eda3a7 Fixes interleaving of waitandgetpod b/w ports msg and component created
fixes #608
Signed-off-by: anmolbabu <anmolbudugutta@gmail.com>
2018-08-08 18:16:03 +05:30
anmolbabu
439b22894a Add information about ports to odo create output
This PR adds message of the form:
"Component $componentName was created and ports $containerPort/$containerProtocol,.... were opened."

fixes #608
Signed-off-by: anmolbabu <anmolbudugutta@gmail.com>
2018-08-08 18:16:03 +05:30
Tomas Kral
8b7a724166 v0.0.9 2018-08-08 11:45:14 +02:00
Charlie Drage
38432c9bf7 Adds ability to pick version when deploying
This adds the ability to pick both the image as well as the image
version when deploying, for example, using `odo create nodejs:8 foobar`
2018-08-02 13:39:39 -04:00
mdas
8926996aef Adds option to allow users to specify port when component is created and the flag is used as --ports 8080/tcp,8081,9100/udp. If the ports flag is not used than the ports, that are exposed by the given image, is used.
It adds a new function getContainerPortsFromString which takes a string array containing the port string e.g 8080/tcp,8081,9090/udp and returns the ContainerPorts or error. If no protocol is passed, tcp is considered as default.

Signed-off-by: mdas <mrinald7@gmail.com>
2018-08-02 14:43:08 +05:30
Tomas Kral
a21102497d Merge pull request #585 from mik-dass/url_revamp
Revamps the URL command and adds support for custom names for url.
2018-08-01 13:56:45 +02:00
mdas
2743a29f79 Removed a unnecessary if condition and modified the test messages 2018-08-01 16:55:40 +05:30
mdas
f4de87abdf Adds new line in getComponent() in cmdutils.go 2018-08-01 15:11:44 +05:30
mdas
a5592b58a2 Revamps the URL command and adds support for custom names for url.
It also adds a component flag to the create command for URL to specify the component. It also changes the behaviour of the odo delete command and now a component flag can be passed to delete the url from or else the current component is used.

Signed-off-by: mdas <mrinald7@gmail.com>
2018-08-01 14:43:45 +05:30
Charlie Drage
c58cf9a65d Show tags / versions when doing odo catalog list
When using `odo catalog list` the tags will now be listed:

```
github.com/redhat-developer/odo  add-versioning ✗                                                                                                                                                                                                                                                                                                                    7d ⚑  ⍉
▶ ./odo catalog list
NAME        TAGS
dotnet      2.0,latest
httpd       2.4,latest
nginx       1.10,1.12,1.8,latest
nodejs      0.10,4,6,8,latest
perl        5.16,5.20,5.24,latest
php         5.5,5.6,7.0,7.1,latest
python      2.7,3.3,3.4,3.5,3.6,latest
ruby        2.0,2.2,2.3,2.4,latest
wildfly     10.0,10.1,8.1,9.0,latest

```
2018-07-26 12:30:58 -04:00
Suraj Narwade
f81cddbb85 Merge pull request #587 from cdrage/update-ps1
Update PS1
2018-07-25 19:19:45 +05:30
Tomas Kral
bc55fb4135 Merge pull request #573 from mik-dass/warn_push_source
Adds a warning/error message when pushing local component
2018-07-25 14:39:31 +02:00
Charlie Drage
e8e223b6ed Merge pull request #503 from surajnarwade/copy-go
Move copyfile function to client-go & remove all ocpath related code
2018-07-24 09:24:17 -04:00
Charlie Drage
6a262c22ec Update PS1
Updates the PS1 output so that "<no application>/<no component>" is
outputted when nothing is detected, rather then the previous
long-string.

This also changes the comparison from error-code to string-checking.

Closes https://github.com/redhat-developer/odo/issues/549
2018-07-24 08:50:04 -04:00
Suraj Narwade
a237d5d32d Move copyfiles function to client-go
Resolves #443

This PR will remove dependency of oc binary for `copyfiles` function which copies file to component while `odo push`
2018-07-23 12:33:40 +05:30
Charlie Drage
44e6f61b3d Merge pull request #518 from mik-dass/update_fix
Fixes odo update from git to binary/local and vice versa
2018-07-20 10:59:52 -04:00
Tomas Kral
292556e417 v0.0.8 2018-07-20 10:43:35 +02:00
mdas
c2ccc3b8e8 Fixed the update issue from the git to local/binary or vice versa.
To achieve this, two functions have been added SetupForSupervisor and CleanupAfterSupervisor in occlient.go. Also some other functions are added in occlient to add and remove initContainers, volumeMounts and volumes to the deploymentConfig. Also updateDcAnnotations in occlient is added to update the annotations in the deploymentConfig.

Signed-off-by: mdas <mrinald7@gmail.com>
2018-07-19 15:12:59 +05:30
Suraj Narwade
c41e1aadf8 Added check for deletion of current component 2018-07-13 15:35:15 +05:30
mdas
40e5c78c6c Adds a warning/error message when pushing local component to a component with a git repo or binary file as source in buildConfig
Signed-off-by: mdas <mrinald7@gmail.com>
2018-07-11 18:33:03 +05:30
Tomas Kral
d2ab498af4 Merge pull request #548 from cdrage/add-io-writer
Adds io.Writer to FollowBuildLog function
2018-07-11 14:09:48 +02:00
Charlie Drage
3606cc6fa7 Merge pull request #541 from surajnarwade/without-storage-name
Generate storage name if not provided
2018-07-05 10:01:13 -04:00
Charlie Drage
50ef7cda4a Merge pull request #546 from surajnarwade/cleaning
Nit picking code
2018-07-03 13:48:22 -04:00
Suraj Narwade
59d188f33a Nit picking code 2018-06-29 11:39:03 +05:30
Suraj Narwade
2c1bccf6df Handle error when no component is there 2018-06-28 13:42:13 +05:30
Charlie Drage
911fccd2db Adds io.Writer to FollowBuildLog function
Adds io.Writer to the FollowBuildLog function. This follows the
convention of only passing in `stdout` from either `color.Output` or
`os.Stdout`.
2018-06-27 15:06:54 -04:00
Charlie Drage
40f69b8989 Merge pull request #536 from cdrage/add-terminal-output
Add terminal command, moves completion and terminal commands to utils
2018-06-27 11:08:53 -04:00
Charlie Drage
0a5c2397c1 Add terminal command, moves completion and terminal commands to utils
This combines both autocompletion and "terminal" commands into one
category (`odo utils`).

The new command added is `odo utils terminal`

This can be used with either bash/zsh by: source <(odo utils terminal
bash/zsh)
2018-06-27 10:33:24 -04:00
Suraj Narwade
6f55d92ddc fixed newline in odo app
As of now,

```
$ odo app
There's no active application.
You can create one by running 'odo application create <name>'.✔ ~/go/src/github.com/redhat-developer/odo [without-storage-name L|⚑ 20]
```

This PR will add newline here so that output will be like,

```
$ odo app
There's no active application.
You can create one by running 'odo application create <name>'.
✔ ~/go/src/github.com/redhat-developer/odo [without-storage-name L|⚑ 20]
```
2018-06-27 12:20:42 +05:30
Suraj Narwade
b80401dbbe Generate storage name if not provided
Resolves #504
2018-06-27 11:39:28 +05:30