-
Notifications
You must be signed in to change notification settings - Fork 243
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
fix (console) : Throw error for crc console
configured with MicroShift preset (#4561)
#4576
Conversation
Skipping CI for Draft Pull Request. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
cmd/crc/cmd/console.go
Outdated
@@ -44,6 +46,9 @@ func showConsole(client *daemonclient.Client) (*client.ConsoleResult, error) { | |||
|
|||
func runConsole(writer io.Writer, client *daemonclient.Client, consolePrintURL, consolePrintCredentials bool, outputFormat string) error { | |||
result, err := showConsole(client) | |||
if err == nil && result.ClusterConfig.ClusterType == preset.Microshift { | |||
err = fmt.Errorf("error : this option is not supported for microshift preset. Please refer to the documentation for a list of supported presets for using this option") |
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.
it might be better to tell user which preset it support
err = fmt.Errorf("error : this option is only supported for %s and %s preset", preset.OpenShift, preset.OKD)
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.
Thanks, I've updated it as per your suggestion.
…ift preset (crc-org#4561) Instead of printing wrong information simply throw an error to indicate to the user that `crc console` option is unsupported for MicroShift preset Signed-off-by: Rohan Kumar <[email protected]>
bccc530
to
4224b50
Compare
@rohanKanojia: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Description
Fixes: #4561
Relates to: crc-org/docs#16
Instead of printing wrong information simply throw an error to indicate to the user that
crc console
option is unsupported for MicroShift presetType of change
test, version modification, documentation, etc.)
Proposed changes
Instead of printing wrong information like this:
Thrown error message saying console option is not supported for MicroShift preset:
Testing
crc config set preset microshift
crc setup
crc start
crc console
should throw errorContribution Checklist