feat: Simulated Provider for running IT - #1129
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
9d14f82 to
a15083d
Compare
aaronfern
left a comment
There was a problem hiding this comment.
Thanks for the PR!
Looks good, I only have a few nits
|
Thanks for taking a look |
thiyyakat
left a comment
There was a problem hiding this comment.
Thank you for adding the simulated provider! ❤️ Just a few comments/questions from me. PTAL.
Signed-off-by: Prashant Tak <prashant.tak@sap.com>
Signed-off-by: Prashant Tak <prashant.tak@sap.com>
Signed-off-by: Prashant Tak <prashant.tak@sap.com>
@thiyyakat These logs have some use because it can help trace what happened in the driver call from the time the request was made till it finished. In the simulated provider, we don't have any real activity that's logged/takes time there wouldn't be much value I feel for these, since it can be interpreted from the machine controller logs when these calls are made. But if you think there's use-case still, I don't have strong feelings, I can add the logs indicating what calls are being made. |
Got it. No need to add the logs then. |
Signed-off-by: Prashant Tak <prashant.tak@sap.com>
ab2e63e to
21bd195
Compare
|
Thanks for the changes and for addressing my comments! /lgtm |
|
LGTM label has been added. DetailsGit tree hash: c5c86cf0951c614636bc18de78d60eff4a601d8a |
|
New changes are detected. LGTM label has been removed. |
Signed-off-by: Prashant Tak <prashant.tak@sap.com>
e18b5e5 to
165b1ca
Compare
|
|
||
| // DeleteMachine handles a machine deletion request. For the simulated provider, it just | ||
| // removes the corresponding node from the managedNodes map. | ||
| func (d *DriverImpl) DeleteMachine(_ context.Context, req *driver.DeleteMachineRequest) (resp *driver.DeleteMachineResponse, err error) { |
There was a problem hiding this comment.
Shouldn't we call d.client.CoreV1().Nodes().Delete(ctx, req.Machine.Name, metav1.DeleteOptions{})
There was a problem hiding this comment.
Node deletion is handled by the machine deletion flow itself. As part of Driver interface DeleteMachine call, we don't actually delete the node object.
| return | ||
| } | ||
| node = d.buildNode(req.Machine, req.MachineClass) | ||
| _, err = d.client.CoreV1().Nodes().Create(ctx, node, metav1.CreateOptions{}) |
There was a problem hiding this comment.
VERY MINOR: You can save the node object returned and use it instead of an additional call to get.
There was a problem hiding this comment.
But what if the node object is updated before we attempt to change it's status. Wouldn't it cause a conflictError if we then transition it to a Ready node.
- Add separate go module for simulatedprovider - Introduce objects representing the MCM crds - Retry on failure for transitioning node to Ready - Wait and poll properly for ensuring MCM CRDs are deployed Signed-off-by: Prashant Tak <prashant.tak@sap.com>
41cf475 to
28267a5
Compare
Signed-off-by: Prashant Tak <prashant.tak@sap.com>
c14cd50 to
0fc2dfb
Compare
Signed-off-by: Prashant Tak <prashant.tak@sap.com>
0fc2dfb to
f3f8cb9
Compare
|
PR needs rebase. DetailsInstructions 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-sigs/prow repository. |
What this PR does / why we need it:
This PR introduces Simulated provider to run IT as part of MCM repo's CI/CD. This can also be used as a mock provider with a virtual (kwok) cluster for testing/simulation purposes.
Which issue(s) this PR fixes:
Fixes part of #1120
Special notes for your reviewer:
Recommend reviewing PR commit-wise for an easy time.
Release note: