-
Notifications
You must be signed in to change notification settings - Fork 103
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
Use Helm-style parameters for kudoctl kudo install
command
#283
Conversation
…ead of: `kubectl kudo install kafka -p foo,bar` it would be: `kubectl kudo install kafka -p foo=bar` Additionally, parameter validation is now done before the actual command execution to avoid potential failures down the road. Issue: #225
kudoctl kudo install
commandkudoctl kudo install
command
This may be more of a Cobra and "how does my particular shell work" question, but how does this work if a value is wrapped in quotes? Does it get parsed into a string without the quotes (unless they're escaped)? If we need to handle that detail, make sure the validate func handles 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.
lgtm but let's also aim to update the documentation https://kudo.dev/docs/cli/#install-a-package-with-instancename--parameters with this PR?
kubectl kudo install kafka --instance=my-kafka-name --parameter KAFKA_ZOOKEEPER_URI=zk-zk-0.zk-hs:2181,zk-zk-1.zk-hs:2181,zk-zk-2.zk-hs:2181 --parameter KAFKA_ZOOKEEPER_PATH=/small -p BROKERS_COUNTER=3
@alenkacz @zen-dog I think my comments would establish the CLI's role in parameter parsing (splitting on =) and validation of a Parameter into separate packages that can be worked with, and tested individually. Parameter could then be expanded to be the same struct as the Framework SDK and offer a lot of code re-use and richer functionality. |
agreed, right now
will be parsed without the quotes. When then (
Just when escaping via
into
you see the quotes. I like the idea of having the validate func handle this. |
- used table-driven tests for `TestTableNewInstallCmd_WithParameters` - `validateInstallParameters` now returns all invalid parameters and not just the first one
So instead of
kubectl kudo install kafka -p foo,bar
it would be:kubectl kudo install kafka -p foo=bar
Additionally, parameter validation is now done before the actual command execution to avoid potential failures down the road.
What type of PR is this?
/component kudoctl
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #225
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
Co-authored-by: Alena Varkockova avarkockova@mesosphere.com