-
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
Refactor: fix s2i flag for odo create #4075
Refactor: fix s2i flag for odo create #4075
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4075 +/- ##
=======================================
Coverage 43.33% 43.33%
=======================================
Files 147 147
Lines 12456 12456
=======================================
Hits 5398 5398
Misses 6486 6486
Partials 572 572 Continue to review full report at Codecov.
|
d481ac5
to
9bde3bd
Compare
@prietyc123 satisfied with the message, when devfile does not exist? |
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.
Few changes, otherwise LGTM
if !co.forceS2i { | ||
err = co.checkConflictingFlags() | ||
if err != nil { | ||
return |
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.
return... what? This should be returning err
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.
Its defined here. https://github.com/openshift/odo/blob/ce72fb36681631b908ad7ca4731b2c4623db9823/pkg/odo/cli/component/create.go#L345
That's a golang feature you can define the variable in the return block of function definition
pkg/odo/cli/component/create.go
Outdated
@@ -542,7 +539,7 @@ func (co *CreateOptions) Complete(name string, cmd *cobra.Command, args []string | |||
|
|||
if util.CheckPathExists(co.DevfilePath) || co.devfileMetadata.devfilePath.value != "" { | |||
// Categorize the sections | |||
log.Info("Validation") | |||
log.Info("Validation for Devfile component") |
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.
Don't change this IMO, it should just stay as Validation
. No need to specify Devfile. We're trying to avoid using the word Devfile anyways in the UI, since it's actually what's being used "under the hood" / engine, rather than what the user will be directly interacting with.
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.
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.
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.
Maybe we can revert back to just Validation
after we get rid of S2I totally ?
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.
I think using only Validation
is ok, explicitly specifying Validation for devfile component
/ Validation for S2I component
does not seem very user friendly. To solve the problem in better way we can use a common spinner Validating the component
if one of the s2i or devfile component found just continue with it.
$ odo create java
Validation
✓ Validating the component
if no s2i or devfile component found give a common error
$ odo create abcd
Validation
✗ No component found, please run `odo catalog list components` for a list of supported components.
This way we could avoid the confusing output we have now
$ odo create mmmd
Validation
✗ Checking devfile existence [178883ns]
⚠ Devfile component type mmmd is not supported, please run `odo catalog list components` for a list of supported devfile component types
✗ component type "mmmd" not found
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.
I agree with @adisky we should keep it as Validation
. We should not be outputting both s2i and devfile in the output either...
Having both would indeed confused the user
hasComponent := false | ||
devfileExistSpinner := log.Spinner("Checking devfile existence") | ||
hasComponent := false | ||
var devfileExistSpinner *log.Status |
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.
As someone who wrote the log
library and functionality, I'd suggest we avoid declaring a spinner like this..
You may run into issues in the future where the spinner will encounter a nil pointer.
pkg/odo/cli/component/create.go
Outdated
@@ -849,7 +855,7 @@ func (co *CreateOptions) Validate() (err error) { | |||
return nil | |||
} | |||
|
|||
log.Info("Validation") | |||
log.Info("Validation for S2I component") |
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.
Just keep it as Validation
, I don't think we should declare that it's S2I.. As that would confuse the user.
9bde3bd
to
ce72fb3
Compare
47be165
to
0bb7d35
Compare
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: girishramnani 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 |
/lgtm |
/retest Please review the full test history for this PR and help us cut down flakes. |
6 similar comments
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
3 similar comments
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest |
/retest Please review the full test history for this PR and help us cut down flakes. |
4 similar comments
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
What type of PR is this?
/kind bug
/kind code-refactoring
Which issue(s) this PR fixes:
Fixes #4048 , #4018
How to test changes / Special notes to the reviewer:
Please try out the
odo create
command using all the possible combinations and flags.