Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve service catalog related stuff from PR 413 #680

Merged
merged 1 commit into from
Sep 10, 2018

Conversation

surajnarwade
Copy link
Contributor

Since PR 413 is merged, there were few minor comments charlie mentioned later.
Those comments are addressed in this PR.

@anmolbabu
Copy link
Contributor

@surajnarwade I would be glad if you could also resolve #678 as part of this PR

@@ -34,7 +34,7 @@ var catalogListCmd = &cobra.Command{

var catalogListComponentCmd = &cobra.Command{
Use: "components",
Short: "List all available component types.",
Short: "List all components available.",
Long: "List all available component types from OpenShift's Image Builder.",
Example: ` # Get the supported components
odo catalog list components
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the word components appropriate here as the goal is to list the builder images available. I propose/suggest then that you use this command -> List all builder's images available and odo catalog list builders

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From user perspective, it is component, right ?

@@ -34,7 +34,7 @@ var serviceCreateCmd = &cobra.Command{

If service name is not provided, service type value will be used.

A full list of service types that can be deployed is available using: 'odo service catalog'`,
A full list of service types that can be deployed are available using: 'odo catalog list services'`,
Example: ` # Create new mysql-persistent service from service catalog.
odo service create mysql-persistent
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be consistent, the syntax of this command should be

  • creation : odo catalog service create <name_of_the_service_class>
  • deletion : odo catalog service delete mysql-persistent

WDYT ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

odo catalog is supposed to only list and search images and services
while odo create or odo delete will deal with components and
odo service xxx will deal with services

cmd/catalog.go Outdated
Example: ` # List all services
odo catalog list services

# Search for a supported services
# Search for a supported a service
odo catalog search services mysql
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use the plural or singular form ? If the odo's command can do a search to retrieve all the services containing the word passed as parameter, then go ahead to use the plural services word otherwise that should be the singular -> odo catalog search service mysql

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with @cmoulliard maybe we should use just service instead.

@@ -34,7 +34,7 @@ var serviceCreateCmd = &cobra.Command{

If service name is not provided, service type value will be used.

A full list of service types that can be deployed is available using: 'odo service catalog'`,
A full list of service types that can be deployed are available using: 'odo catalog list services'`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you also envision to list the plans, brokers, instances and bindings created ?

odo catalog list services|plans|brokers|bindings

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think,

  • odo catalog list services should show service name, plans & required parameters

  • odo service create service_name --plan plan_name -p parameters

  • odo link component_name --service service_name which will do the binding stuff

WDYT ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a) Plan detail

You need a command to show the detail of a plan as we can do with svcat
We could then use by example : odo catalog plan <serviceName>/<planName>

b) Create service
I agree with you for the command to create the service excepted that you must also pass the class name

odo service create service_name --class class_name --plan plan_name -p parameters

Remark : As some parameters are json typed, then it will be very difficult to pass them using a one line command and -p, -p ... This is why, we have in our prototype, defined such parameters/info into a yaml config file

c) Mount the secret to component/

To do the binding, then you must also pass the name of the secret

odo link component_name --secret secret_name

component_name corresponds to the DeploymentConfig's name
secret_name : secret containing the parameters

Remark : There is a step that you don't convert which is "generating the secret with the parameters of the plan selected. Is it something that you will do automatically during the creation of the service ? If this is what you plan to do, then you must also pass the name of the secret ->

odo service create service_name --class class_name --plan plan_name --secret secret_name -p parameters

Copy link
Contributor

@anmolbabu anmolbabu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you missed #413 (comment)

@@ -34,7 +34,7 @@ var catalogListCmd = &cobra.Command{

var catalogListComponentCmd = &cobra.Command{
Use: "components",
Short: "List all available component types.",
Short: "List all components available.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I seem to get confused between component and component type
My current understanding is that a component is an application built using a builder imagestream of type same as component type.. which makes me arrive at
component === app
component type === builder image stream of respective type..
It is possible that I am missing something
Please correct me if I am wrong...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • App is your application which consist of multiple components
  • Components is one of the part of your app
  • component type is type of component, for example, java or python

cmd/catalog.go Outdated
Example: ` # List all services
odo catalog list services

# Search for a supported services
# Search for a supported a service
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Search for a supported service :)

cmd/catalog.go Outdated
Short: "Lists all the services from service catalog",
Long: "Lists all the services from service catalog",
Short: "Lists all services available",
Long: "Lists all services available",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be : List all available services ? @cdrage

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup. That's correct

@cdrage
Copy link
Member

cdrage commented Aug 30, 2018

May be good to change the title / name as well to not include my name haha. Maybe "Improve documentation for catalog" or something along those lines.

@surajnarwade surajnarwade changed the title Added charlie's comment from PR 413 Improve service catalog related stuff from PR 413 Aug 30, 2018
cmd/catalog.go Outdated
Short: "Lists all the services from service catalog",
Long: "Lists all the services from service catalog",
Short: "Lists all services available",
Long: "Lists all services available",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup. That's correct

cmd/catalog.go Outdated
Example: ` # List all services
odo catalog list services

# Search for a supported services
# Search for a supported a service
odo catalog search services mysql
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with @cmoulliard maybe we should use just service instead.

cmd/service.go Outdated
odo service delete mysql-persistent
`,
Args: cobra.MaximumNArgs(1),
Run: func(cmd *cobra.Command, args []string) {
glog.V(4).Infof("service delete called")

glog.V(4).Infof("service delete called\n")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

similar to my previous comment, can we merge these two debug / info messages?

@cdrage
Copy link
Member

cdrage commented Sep 4, 2018

This LGTM. Need more reviews however before merging.

@cdrage
Copy link
Member

cdrage commented Sep 6, 2018

@surajnarwade needs another rebase and LGTM.

Copy link
Contributor

@mik-dass mik-dass left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR LGTM, merge once travis is green though

Since PR 413 is merged, there were few minor comments charlie mentioned later.
Those comments are addressed in this PR.
@mik-dass mik-dass merged commit 82d6be7 into redhat-developer:master Sep 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants