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
Generated client: embed generated methods into VM interface #11523
Generated client: embed generated methods into VM interface #11523
Conversation
@xpivarc @Barakmor1 Follow-up of #11495 for VirtualMachineInterface |
3f5e956
to
76403ec
Compare
76403ec
to
5c64385
Compare
5c64385
to
1a11486
Compare
1a11486
to
9c483d5
Compare
9c483d5
to
5d245a3
Compare
/retest |
5d245a3
to
d68e6cc
Compare
@Barakmor1 Thanks! There was a build error for a new create/delete/get VM method introduced in |
/lgtm |
Required labels detected, running phase 2 presubmits: |
/retest |
/hold |
vm.Create method does not allow to pass the CreateOptions. In order to align the custom method signature with the generated one introduce the possibility to pass the CreateOptions. This effort, once all the common methods' signatures are aligned with the generated ones, will converge in the deletion of the custom methods' implementations, embedding the generated interface. Signed-off-by: fossedihelm <ffossemo@redhat.com>
…et method vm.Get method allow to pass the pointer to GetOptions. In order to align the custom method signature with the generated one switch using the GetOptions instead of the pointer one. This effort, once all the common methods' signatures are aligned with the generated ones, will converge in the deletion of the custom methods' implementations, embedding the generated interface. Signed-off-by: fossedihelm <ffossemo@redhat.com>
…List method vm.List method allow to pass the pointer to ListOptions. In order to align the custom method signature with the generated one switch using the ListOptions instead of the pointer one. This effort, once all the common methods' signatures are aligned with the generated ones, will converge in the deletion of the custom methods' implementations, embedding the generated interface. Signed-off-by: fossedihelm <ffossemo@redhat.com>
vm.Update method does not allow to pass the UpdateOptions. In order to align the custom method signature with the generated one introduce the possibility to pass the UpdateOptions. This effort, once all the common methods' signatures are aligned with the generated ones, will converge in the deletion of the custom methods' implementations, embedding the generated interface. Signed-off-by: fossedihelm <ffossemo@redhat.com>
…m.Delete method vm.Delete method allow to pass the pointer to DeleteOptions. In order to align the custom method signature with the generated one switch using the DeleteOptions instead of the pointer one. This effort, once all the common methods' signatures are aligned with the generated ones, will converge in the deletion of the custom methods' implementations, embedding the generated interface. Signed-off-by: fossedihelm <ffossemo@redhat.com>
….Patch and vm.PatchStatus methods vm.Patch and vm.PatchStatus method allow to pass the pointer to PatchOptions. In order to align the custom method signature with the generated one switch using the PatchOptions instead of the pointer one. This effort, once all the common methods' signatures are aligned with the generated ones, will converge in the deletion of the custom methods' implementations, embedding the generated interface. Signed-off-by: fossedihelm <ffossemo@redhat.com> Signed-off-by: fossedihelm <ffossemo@redhat.com>
vm.UpdateStatus method does not allow to pass the UpdateOptions. In order to align the custom method signature with the generated one introduce the possibility to pass the UpdateOptions. This effort, once all the common methods' signatures are aligned with the generated ones, will converge in the deletion of the custom methods' implementations, embedding the generated interface. Signed-off-by: fossedihelm <ffossemo@redhat.com>
The embed will provide us new methods (`DeleteCollection` and `Watch`). Signed-off-by: fossedihelm <ffossemo@redhat.com>
d68e6cc
to
5a42eb4
Compare
/unhold |
/lgtm |
Required labels detected, running phase 2 presubmits: |
/retest-required |
1 similar comment
/retest-required |
@fossedihelm: The following test failed, say
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-required |
What this PR does
Before this PR:
We have our custom
virtualMachineInterface
interface with the commonGet
,Delete
, etc... methods and the customized ones (Migrate
....)From #11297 the common methods implementation works as a wrapper with different signatures for the generated ones, redirecting the requests to them.
After this PR:
Convert using the generated client signatures instead of the custom one. The generated
virtualMachineInterface
is embedded into our custom one, also providing newDeleteCollection
andWatch
methods.The changes inherited are:
Patch
andPatchStatus
now use metav1.PatchOptions{} instead of *metav1.PatchOptions{}.List
now uses metav1.ListOptions{} instead of *metav1.ListOptions{}.Get
now uses metav1.GetOptions{} instead of *metav1.GetOptions{}.Delete
now uses metav1.DeleteOptions{} instead of *metav1.DeleteOptions{}.Create
now receives metav1.CreateOptions{} too.Update
andUpdateStatus
now receive metav1.UpdateOptions{} too.DeleteCollection
,Watch
methods.Fixes #
Why we need it and why it was done in this way
The following tradeoffs were made:
The following alternatives were considered:
Links to places where the discussion took place:
Special notes for your reviewer
For an easier review process the commits was splitted in the following manner:
Create
- introducedCreateOptions
Get
- usedGetOptions
instead of the pointerList
- usedListOptions
instead of the pointerUpdate
- introducedUpdateOptions
Delete
- usedDeleteOptions
instead of the pointerPatch
andPatchStatus
- usedPatchOptions
instead of the pointerUpdateStatus
- introducedUpdateOptions
VirtualMachineInterface
into the custom one.Checklist
This checklist is not enforcing, but it's a reminder of items that could be relevant to every PR.
Approvers are expected to review this list.
Design: A design document was considered and is present (link) or not requiredTesting: New code requires new unit tests. New features and bug fixes require at least on e2e testDocumentation: A user-guide update was considered and is present (link) or not required. You want a user-guide update if it's a user facing feature / API change.Community: Announcement to kubevirt-dev was consideredRelease note