-
Notifications
You must be signed in to change notification settings - Fork 244
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
Don't panic when an invalid component name is passed in #2839
Don't panic when an invalid component name is passed in #2839
Conversation
Signed-off-by: John Collier <John.J.Collier@ibm.com>
8fed362
to
a4f3909
Compare
Signed-off-by: John Collier <John.J.Collier@ibm.com>
Codecov Report
@@ Coverage Diff @@
## master #2839 +/- ##
==========================================
+ Coverage 43.64% 43.67% +0.03%
==========================================
Files 94 95 +1
Lines 8743 8762 +19
==========================================
+ Hits 3816 3827 +11
- Misses 4563 4571 +8
Partials 364 364
Continue to review full report at Codecov.
|
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.
works for me locally and CI is green
/lgtm
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kadel The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind bug
What does does this PR do / why we need it:
This PR fixes the issue seen in #2826 when
odo
would panic if experimental mode was enabled and an invalid component name was passed intoodo create
.The issue was caused by a partially initialized CLI context being created when experimental mode is true, which caused fields needed for odo-s2i like
LocalConfigInfo
to be nil in the CLI context. When an invalid/non-existent devfile component name is passed in, odo would fall back to trying to create an s2i-style component. But since the CLI context wasn't properly initialized, a null pointer exception would occur and odo would panic.Which issue(s) this PR fixes:
Fixes #2826
How to test changes / Special notes to the reviewer:
odo create fake-component
, you should see something like this:make test-cmd-devfile-create
to verify the updated functional tests that capture this scenario