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

Bug 2106471: Fix collision when collecting VM CRs #54

Merged
merged 1 commit into from Jul 12, 2022

Conversation

mansam
Copy link
Collaborator

@mansam mansam commented Jul 11, 2022

Targeted collection fails for a VM if its name is a substring of another VM in the same namespace, due to grep returning multiple matches for the name. Add -w flag to do a whole-word comparison and avoid the collision.

sh-4.4$ oc get virtualmachines -A | grep auto-rhv-red-iscsi-migration-50gb-70usage-vm-2
openshift-mtv   auto-rhv-red-iscsi-migration-50gb-70usage-vm-2    5d12h   Stopped   False
openshift-mtv   auto-rhv-red-iscsi-migration-50gb-70usage-vm-20   5d11h   Stopped   False
openshift-mtv   auto-rhv-red-iscsi-migration-50gb-70usage-vm-21   5d11h   Stopped   False
openshift-mtv   auto-rhv-red-iscsi-migration-50gb-70usage-vm-22   5d11h   Stopped   False
openshift-mtv   auto-rhv-red-iscsi-migration-50gb-70usage-vm-23   5d11h   Stopped   False
openshift-mtv   auto-rhv-red-iscsi-migration-50gb-70usage-vm-24   5d11h   Stopped   False
openshift-mtv   auto-rhv-red-iscsi-migration-50gb-70usage-vm-25   5d11h   Stopped   False
openshift-mtv   auto-rhv-red-iscsi-migration-50gb-70usage-vm-26   5d11h   Stopped   False
openshift-mtv   auto-rhv-red-iscsi-migration-50gb-70usage-vm-27   5d11h   Stopped   False

sh-4.4$ oc get virtualmachines -A | grep -w auto-rhv-red-iscsi-migration-50gb-70usage-vm-2
openshift-mtv   auto-rhv-red-iscsi-migration-50gb-70usage-vm-2    5d12h   Stopped   False

Targeted collection fails for a VM if its name is a substring
of another VM in the same namespace, due to grep returning
multiple matches for the name. Add -w flag to do a whole-word
comparison and avoid the collision.
@mansam mansam requested a review from aufi July 11, 2022 21:06
Copy link
Collaborator

@aufi aufi left a comment

Choose a reason for hiding this comment

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

Looks good, thanks for the PR!

@mansam mansam merged commit cd4ff93 into kubev2v:main Jul 12, 2022
1 check passed
@mansam mansam changed the title Fix collision when collecting VM CRs Bug 2106471: Fix collision when collecting VM CRs Jul 12, 2022
@github-actions
Copy link

Bug 2106471 does not have a target release set

mansam added a commit that referenced this pull request Jul 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants