Remove kubevirt dependencies#574
Conversation
|
/cherry-pick release-0.49 |
|
@RamLavi: once the present PR merges, I will cherry-pick it on top of DetailsIn response to this:
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-sigs/prow repository. |
tests/tests.go
Outdated
| _ = corev1.AddToScheme(scheme) | ||
| _ = v1.AddToScheme(scheme) |
There was a problem hiding this comment.
It seems there is no need to register those (corev1, app/v1 clients), k8sClient should provide these clients, right?
tests/tests.go
Outdated
| @@ -67,16 +71,42 @@ var ( | |||
|
|
|||
| type TestClient struct { | |||
| VirtClient kubecli.KubevirtClient | |||
There was a problem hiding this comment.
Please consider marking VirtClient as deprecated with message saying controller-runtime client should be used instead.
There was a problem hiding this comment.
it's going away in next commit by why not.
DONE
| err := testClient.CRClient.Get(context.Background(), | ||
| client.ObjectKey{Namespace: vm.Namespace, Name: vm.Name}, updatedVM) | ||
| if err != nil { |
There was a problem hiding this comment.
nit: Please consider in-lining the condition clause for reducing scope of returned values.
Here and in other occurrences.
There was a problem hiding this comment.
let's to it in a follow up PR, this one has too much going on it as it is :)
| var err error | ||
| virtualMachine, err = testClient.VirtClient.VirtualMachine(virtualMachine.Namespace).Get(context.TODO(), | ||
| virtualMachine.Name, metav1.GetOptions{}) | ||
| err = testClient.CRClient.Get(context.TODO(), |
There was a problem hiding this comment.
context.TODO is deprecated, please use context.Background. Here and in other occurrences.
Dont we have linter rule for that? 🤔
There was a problem hiding this comment.
Same - I'll do it in a follow up
Dont we have linter rule for that? 🤔
donno, but I'll see if the linter needs bumping..
| ) | ||
|
|
||
| type TestClient struct { | ||
| VirtClient kubecli.KubevirtClient |
There was a problem hiding this comment.
Ah so this is removed eventually.. please consider mentioning in the first commit message virtClient is going to be removed in follow-up commit.
There was a problem hiding this comment.
It's written but maybe I should also explicitly state it as depreacted for formality
There was a problem hiding this comment.
Nahh I dont think its necessary because its gone in the same PR, I already reviewed it and aware of the changes.
|
please consider adding on PR desc that it was removed in favor of using controller runtime |
Introduce kubernetes.Interface and controller-runtime client to TestClient structure while keeping the existing VirtClient for backward compatibility. This allows gradual migration of test code without breaking existing tests. Signed-off-by: Ram Lavi <ralavi@redhat.com>
This covers all standard Kubernetes operations (Pods, Deployments, Namespaces, ConfigMaps, Secrets, etc). Signed-off-by: Ram Lavi <ralavi@redhat.com>
Replace all VirtualMachine CRUD operations from kubevirt client-go typed client to controller-runtime client. Signed-off-by: Ram Lavi <ralavi@redhat.com>
Remove VirtClient field and kubecli dependency from test infrastructure since all operations now use kubernetes.Interface and controller-runtime client. Signed-off-by: Ram Lavi <ralavi@redhat.com>
Remove kubevirt.io/client-go from go.mod All kubevirt API operations now use controller-runtime client with kubevirt.io/api types. This commit consists of the 'make vendor' changes. Signed-off-by: Ram Lavi <ralavi@redhat.com>
6b5cf61 to
d1e7bfa
Compare
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: RamLavi The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@RamLavi: Failed to get PR patch from GitHub. This PR will need to be manually cherrypicked. Error messagestatus code 406 not one of [200], body: {"message":"Sorry, the diff exceeded the maximum number of files (300). Consider using 'List pull requests files' API or locally cloning the repository instead.","errors":[{"resource":"PullRequest","field":"diff","code":"too_large"}],"documentation_url":"https://docs.github.com/rest/pulls/pulls#list-pull-requests-files","status":"406"}DetailsIn response to this:
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-sigs/prow repository. |
funny one |
What this PR does / why we need it:
This PR removes the dependency with kubevirt/go-client and makes the vendor much more easy to maintain.
the virtctl client is removed in favor of controller runtime client.
Special notes for your reviewer:
Release note: