-
Notifications
You must be signed in to change notification settings - Fork 29
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: merge create and update plans and update references #192
Conversation
core/plans/const.go
Outdated
MicroVMCreatePlanName = "microvm_create" | ||
MicroVMUpdatePlanName = "microvm_update" |
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.
Do we need these two?
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.
Nope, removed
case p.vm.Spec.UpdatedAt != 0: | ||
err = p.update(ctx, ports) | ||
default: | ||
err = p.create(ctx, ports) | ||
} |
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 we can remove this completely and just walk through with all the steps, like "create microvm" and the step will say "no it's running, we don't have to do this".
@richardcase: Any idea/plan/suggestion?
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 had considered this, but I think the mental overhead of keeping them separate isn't very large, and until we actually implement the update logic it's hard to know how different the two are.
886f1e9
to
bbff50c
Compare
Codecov Report
@@ Coverage Diff @@
## main #192 +/- ##
==========================================
+ Coverage 54.89% 55.44% +0.54%
==========================================
Files 45 44 -1
Lines 1991 1984 -7
==========================================
+ Hits 1093 1100 +7
+ Misses 791 777 -14
Partials 107 107
Continue to review full report at Codecov.
|
What this PR does / why we need it:
Merges create and update plans into a single plan builder. The update plan currently has no implementation. Update references to the plan.
The update plan code branch is reached if
vm.Spec.UpdatedAt
property is not set (defaults to 0).Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #156
Checklist: