Skip to content
This repository has been archived by the owner on Oct 10, 2023. It is now read-only.

Clarify error when discovery source is invalid #3134

Merged
merged 1 commit into from
Aug 15, 2022

Conversation

marckhouzam
Copy link
Contributor

What this PR does / why we need it

Clarify error when a plugin discovery source is invalid versus when it is not yet supported.

Which issue(s) this PR fixes

Fixes #3078

Describe testing done for PR

Before the PR we can see that an invalid discovery source of type fish gives the same error as an valid but unsupported discovery source type of GCP:

$ tanzu plugin source add -n test -u example.com/test --type fish
✖  discovery source type 'fish' is not yet supported
$ tanzu plugin source add -n test -u example.com/test --type GCP
✖  discovery source type 'GCP' is not yet supported

With the PR applied, only valid discovery source types give the unsupported error, while others give an invalid error:

$ tz plugin source add -n test -u example.com/test --type fish
✖  unknown discovery source type 'fish'
$ tz plugin source add -n test -u example.com/test --type GCP
✖  discovery source type 'GCP' is not yet supported
$ tz plugin source add -n test -u example.com/test --type kubernetes
✖  discovery source type 'kubernetes' is not yet supported
$ tz plugin source add -n test -u example.com/test --type rest
✖  discovery source type 'rest' is not yet supported

Release note

Improved error messages when the user attempts to add a discovery source of an invalid type.

Signed-off-by: Marc Khouzam <kmarc@vmware.com>
@marckhouzam marckhouzam requested a review from a team as a code owner August 15, 2022 13:47
Copy link
Contributor

@anujc25 anujc25 left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for the fix.

@anujc25 anujc25 added ok-to-merge PRs should be labelled with this before merging kind/bug PR/Issue related to a bug area/core-cli labels Aug 15, 2022
@marckhouzam
Copy link
Contributor Author

Thanks for the quick review @anujc25 !

@marckhouzam marckhouzam merged commit 5148fce into vmware-tanzu:main Aug 15, 2022
@marckhouzam marckhouzam deleted the fix/errorDiscoveryAdd branch August 15, 2022 14:55
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
area/core-cli cla-not-required kind/bug PR/Issue related to a bug ok-to-merge PRs should be labelled with this before merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Misleading error message for unknown discovery source type
3 participants