-
Notifications
You must be signed in to change notification settings - Fork 102
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
adding params list #1029
adding params list #1029
Conversation
This looks great, thanks @kensipe. As an operator developer I can see two different but similar parameter-related sets of operations: on packages and on instances. For listing package parameters it would probably make sense to specify a package version, since parameters will potentially change across versions. Would it make sense to interact in terms of For listing instance parameters it would make sense to show the actual current parameter value as well, and differently from listing package parameters, the version is implied by the instance itself. I was trying to think of a CLI UX that is consistent with (Brackets signify optional arguments). Listing a package's parameters:
Listing an instances's parameters (note the "Value" column):
Showing an instances's
All of these commands also possibly accepting |
For context, the package/instance distinction exists in DC/OS services. A service operator can both get the package's parameters (with default, required, description), and a service instance's parameters (with the actual values). |
I think I prefer to use of |
The PR desc provides the reasons for the flags... there is definitely value in |
9cce73a
to
9097136
Compare
Makes sense! |
@mpereira I really like you proposal... however it is for a completely different feature. It seems to be focused on getting params from instances. This PR is for operators (which are not installed yet). I will write up an issue to make sure we don't miss this... it's a great idea. This PR now, reorgs |
New feature details here: #1030 The review of this PR should be focused on operators (to be installed day 1) not instances in day 2. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the direction, I think there's not much left to do to land this once we agree on the UX of the commands (I had few suggestions).
pkg/kudoctl/cmd/operator.go
Outdated
provide a list of parameters from a remote operator given a url or repository along with the name and version. | ||
` | ||
|
||
const operatorExamples = ` kubectl kudo operator package [operator folder] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wondering why did you go with the extra operator level here. To me it's kind of redundant... Do you think that following would not be enough?
kudo package params
kudo package verify
kudo package info
or something along those lines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the use of package
is challenging if we use package
to package an operator. It works if we perhaps add a package create
.... which is currently operator package
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prior to this PR... kudo package
was an action... it took an operator folder and made a package. This PR and feature is provide info back... it seems slightly incongruent... but the issue is package [folder]
and package params [xyz]
doesn't work together. If we are stuck on putting it all under package... than we would need a package create [folder]
for the current package
feature.
cmd := &cobra.Command{ | ||
Use: "list [operator]", | ||
Short: "List operator parameters", | ||
Example: " kubectl kudo params list", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is no longer true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesn't match the use either right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets get agreement on the UX before we critic the examples...
Short: "List operator parameters", | ||
Example: " kubectl kudo params list", | ||
RunE: func(cmd *cobra.Command, args []string) error { | ||
//list.home = Settings.Home |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need this? Otherwise please remove it...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is removed in the merging in PR for verify
return nil | ||
} | ||
// names only | ||
if cmd.namesOnly { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so this is named namesOnly but you can still combine it with --descriptions which means you get also other? I guess those two should be mutually exclusive?
What do you think about moving this closer to kubectl. That mean having a pre-defined set of columns that are printed by default (some basic ones) and then supporting -o custom-columns=xxx
as kubectl does. I really like that design...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i like that, but maybe not for this PR? this gets me thinking too, we should probably specify additionalPrintColumns for our CRDs (also not part of this PR)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(the custom columns that is - agreed on making them mutually exclusive today)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
then let's have a predefined set of columns in this PR and add the ability to customize it in any way in the next one... (removing flags is also breaking change :))
pkg/kudoctl/cmd/operator_verify.go
Outdated
@@ -0,0 +1,38 @@ | |||
package cmd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's many separate this into a different PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have nothing valuable to add on top of Alena's review, mostly echoing her. Overall everything looks good to me.
@kensipe agreed wrt to "instance params" being a whole different feature. Thanks for creating the issue for it! |
1f908fe
to
fbeb3ff
Compare
Provides a table list of params for varies reasons. It will work for local or repo packages.
It can be useful for the operator developer... but likely it is most useful to the user of the packages for the follow reasons:
Currently there are several flags with their reasons:
--names-only
displays only the param names. the uitables is very limiting and the column widths sometimes truncate the names. names-only doesn't truncate.--required
displays only column names as well... but the list is limited to only the params which are required but do not have a default. You can think of required differently here... here it is user required to install this operator.--descriptions
the default table will print name, required and default and no desc (which can be length). specifying--descriptions
adds the desc column.** several operators were used for building this feature out... Kafka was the most interesting based on number of params and length of param names and descriptions.
Example output:
default view
required view
names-only
description view
It also supports pulling from a repo... but the community repo is not compat with kudo master right now.