Skip to content
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

kubevirt: Propertly remove migration leftovers #4370

Merged

Conversation

qinqon
Copy link
Contributor

@qinqon qinqon commented May 17, 2024

What this PR does and why is it needed

After merging 469c4e8 the live migration leftovers were not removed since all the VM's pods are at completed state so the cleanup was skip.

This change simplify that logic by removing left overs if all the VM's pods are completed.

kubevirt: Propertly remove migration leftovers

@qinqon qinqon requested a review from a team as a code owner May 17, 2024 14:09
@qinqon qinqon requested a review from pperiyasamy May 17, 2024 14:09
@qinqon qinqon marked this pull request as draft May 17, 2024 14:17
@qinqon qinqon force-pushed the kubevirt-propertly-remove-left-overs branch 2 times, most recently from 71d5668 to 5993aa9 Compare May 22, 2024 09:32
@qinqon qinqon marked this pull request as ready for review May 22, 2024 09:33
@qinqon qinqon force-pushed the kubevirt-propertly-remove-left-overs branch 2 times, most recently from 1ae2e96 to 16efdab Compare May 22, 2024 12:49
pod, err := fakeOvn.fakeClient.KubeClient.CoreV1().Pods(t.namespace).Get(context.TODO(), t.podName, metav1.GetOptions{})
Expect(err).NotTo(HaveOccurred())
pod.Status.Phase = corev1.PodSucceeded
_, err = fakeOvn.fakeClient.KubeClient.CoreV1().Pods(t.namespace).UpdateStatus(context.TODO(), pod, metav1.UpdateOptions{})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit. does UpdateStatus expect to pass at first attempt itself ? or do we need multiple attempts with eventually here ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unit testing, fakeClient has no conflicts mechanism, this is good enough.

Expect(err).NotTo(HaveOccurred())
pod.Status.Phase = corev1.PodSucceeded
_, err = fakeOvn.fakeClient.KubeClient.CoreV1().Pods(t.namespace).UpdateStatus(context.TODO(), pod, metav1.UpdateOptions{})
Expect(err).NotTo(HaveOccurred())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

@pperiyasamy
Copy link
Contributor

LGTM

@qinqon
Copy link
Contributor Author

qinqon commented May 23, 2024

Failure not related

@jcaamano
Copy link
Contributor

@qinqon can you add doc text to CleanUpLiveMigratablePod explaining that it cleans up VM stuff when there are no running pods for it?

@qinqon qinqon force-pushed the kubevirt-propertly-remove-left-overs branch 2 times, most recently from 9cbaca9 to 5cae8fc Compare May 27, 2024 05:52
@qinqon
Copy link
Contributor Author

qinqon commented May 27, 2024

Unit test failure not related

 �[91m�[1m[Fail] �[0m�[90mHybrid SDN Master Operations �[0m�[91m�[1m[It] handles a HO node is switched to a OVN node �[0m
2024-05-27T06:13:58.3176066Z �[37m/home/runner/work/ovn-kubernetes/ovn-kubernetes/go-controller/pkg/ovn/hybrid_test.go:1375�[0m

After merging [1] the live migration leftovers were not removed since
all the VM's pods are at completed state so the cleanup was skip.

This change simplify that logic by removing left overs if all the VM's
pods are completed.

[1] 469c4e8

Signed-off-by: Enrique Llorente <[email protected]>
@qinqon qinqon force-pushed the kubevirt-propertly-remove-left-overs branch from 5cae8fc to 2713fc8 Compare May 27, 2024 06:20
@coveralls
Copy link

Coverage Status

coverage: 52.57% (-0.05%) from 52.623%
when pulling 2713fc8 on qinqon:kubevirt-propertly-remove-left-overs
into 49e1aea on ovn-org:master.

@jcaamano jcaamano merged commit 03f117e into ovn-org:master May 27, 2024
35 checks passed
@tssurya tssurya added area/e2e-testing feature/kubevirt-live-migration All issues related to kubevirt live migration labels May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/e2e-testing feature/kubevirt-live-migration All issues related to kubevirt live migration
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

5 participants