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

Return user friendly error when package doesn't exist #1322

Merged
merged 1 commit into from
Jan 18, 2024

Conversation

rcmadhankumar
Copy link
Contributor

What this PR does / why we need it:

Return user friendly error when package doesn't exist

$ kubectl get package foo.1.0.0
Error from server (NotFound): package.data.packaging.carvel.dev "foo.1.0.0" not found

$kctrl package available get -p foo/1.0.0
kctrl: Error: package.data.packaging.carvel.dev "foo.1.0.0" not found

Which issue(s) this PR fixes:

Fixes #594

Does this PR introduce a user-facing change?

NONE

Additional Notes for your reviewer:

Review Checklist:
  • Follows the developer guidelines
  • Relevant tests are added or updated
  • Relevant docs in this repo added or updated
  • Relevant carvel.dev docs added or updated in a separate PR and there's
    a link to that PR
  • Code is at least as readable and maintainable as it was before this
    change

Additional documentation e.g., Proposal, usage docs, etc.:

NONE

@rcmadhankumar rcmadhankumar force-pushed the downstream/issue-594 branch 2 times, most recently from 5fb04ee to 4291bdc Compare September 26, 2023 09:05
@rcmadhankumar
Copy link
Contributor Author

@100mik @praveenrewar can you review this?

@rcmadhankumar rcmadhankumar force-pushed the downstream/issue-594 branch 6 times, most recently from a7876ac to b29b1d2 Compare January 9, 2024 09:47
Copy link
Member

@praveenrewar praveenrewar left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Member

@joaopapereira joaopapereira left a comment

Choose a reason for hiding this comment

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

Made some comments with some suggested changes for the PR. In general looks good.
Since we are starting to use testify in the tests, it would be good if we did update, at least the test file to use require instead of the t.Fatalf.

test/e2e/kappcontroller/package_test.go Outdated Show resolved Hide resolved
test/e2e/kappcontroller/package_test.go Outdated Show resolved Hide resolved
Copy link
Member

@joaopapereira joaopapereira left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@praveenrewar praveenrewar left a comment

Choose a reason for hiding this comment

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

LGTM!

@praveenrewar praveenrewar merged commit 0972b2f into carvel-dev:develop Jan 18, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
3 participants