-
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
Convert s2i components to devfile #3549
Convert s2i components to devfile #3549
Conversation
78d84d3
to
4ea1743
Compare
|
||
// AddComponent adds component to devfile | ||
func (d *Devfile200) AddComponent(component common.DevfileComponent) { | ||
d.Components = append(d.Components, 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.
should we check for duplicates?
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.
yes, updating
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.
Done.
Few observations/questions:
|
I think it is not a problem, anyways we are taking out devfile from experimental mode
I don't know how to preserve order for a generated yaml, would check about this.
isn't it expected? I believe that if the new devfile component deployed successfully user then deletes the old one? even if we want to delete it, it should ne be done with |
@dharmit addressed your comments for ordering the yaml, now it is generating in order. |
pkg/odo/cli/utils/migrate.go
Outdated
return errors.Wrap(err, "Error in generating env.yaml") | ||
} | ||
|
||
// TODO: Delete the s2i component and deploy the 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.
TODO 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.
It is just a note about the data we are unable to migrate.
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.
Please update with some reasoning and also the link to the issue if available.
pkg/odo/cli/utils/migrate.go
Outdated
/* This data is yet to be converted | ||
|
||
// Absolute path | ||
sourcePath, _ := context.LocalConfigInfo.GetOSSourcePath() | ||
minMemory := context.LocalConfigInfo.GetMinMemory() | ||
minCPU := context.LocalConfigInfo.GetMinCPU() | ||
maxCPU := context.LocalConfigInfo.GetMaxCPU() | ||
|
||
*/ |
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.
seems like a TODO
pkg/odo/cli/utils/migrate.go
Outdated
// TODO | ||
// lables and annotations that are added on s2i components |
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.
TODO found
pkg/odo/cli/utils/migrate.go
Outdated
if err != nil { | ||
return err | ||
} | ||
log.Italic("devfile.yaml is available in current directory, run `odo push` to deploy devfile component and `odo delete` to delete s2i component.\n") |
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.
won't running odo delete
after push delete the 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.
you have an s2i component in folder
- cd my-s2i-component
- run
odo utils migrate-to-devfile
(generates devfile.yaml, env.yaml) - odo push (since devfile has priority over s2i, devfile component would get deployed. s2i would is still exisiting)
- odo delete(s2i has priority over for delete, so s2i would get deleted)
- you have now running 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.
This sounds confusing TBH. How about we suggest delete before push? Will that work?
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.
yes, but what would happen when odo push for devfile gets failed and user lost the old s2i component as well?
in ideal migration strategy the when the new deployment gets successful then only the old one rolled back.
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.
OK 👍 Please add a comment regarding this.
pkg/odo/cli/utils/migrate.go
Outdated
// NewCmdMigrate implements the odo utils migrate-to-devfile command | ||
func NewCmdMigrate(name, fullName string) *cobra.Command { | ||
o := NewMigrateOptions() | ||
migrateCmd := &cobra.Command{ |
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.
please add some integration tests for this command.
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.
would update
@mik-dass what is the problem with TODO's in code? these are for future references like app label is still under development. |
Some of them are confusing as to why they are not a part of this PR. We should provide proper reasoning as to why they are not implemented in this PR. Links to known issues are even better. Without them, the PR review becomes confusing. |
yes correct, so you should give comment like please elaborate TODO, only |
That's how I have always started a conversation regarding the TODO as the details has not been provided and I end up assuming it to be personal notes for the future. He/she can always reply back in the review comment. Anyways, will keep this in mind next time. |
/retest |
/retest |
pkg/odo/cli/utils/convert.go
Outdated
endpoint := common.Endpoint{ | ||
Name: fmt.Sprintf("port-%s", port[0]), | ||
TargetPort: int32(portInt), | ||
Configuration: &common.Configuration{ |
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 configuration was removed from the schema recently https://github.com/devfile/kubernetes-api/blob/master/schemas/devfile.json#L439
check if s2i component is present for deletion first
update 2.0 go struct to preserve yaml order
rename it to convert add --s2i flag for odo delete
This reverts commit 06392de.
This reverts commit 18c142e.
@adisky: The following tests 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/test-infra repository. I understand the commands that are listed here. |
/retest |
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
/lgtm
What type of PR is this?
/kind feature
What does does this PR do / why we need it:
Convert s2i local components to devfile.yaml
Which issue(s) this PR fixes:
fixes #3156
How to test changes / Special notes to the reviewer:
(due to these changes Added ODO_S2I_CONVERTED_DEVFILE env variable odo-init-image#70)
Now Convert this s2i component to devfile