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

refactor: drop GetPodByVirtualMachineInstance,getPodsByLabel . Use libpod.GetPodByVirtualMachineInstance instead at all its callers. #11474

Merged
merged 1 commit into from
Mar 12, 2024

Conversation

TheRealSibasishBehera
Copy link
Contributor

@TheRealSibasishBehera TheRealSibasishBehera commented Mar 8, 2024

What this PR does

Before this PR:

The function GetPodByVirtualMachineInstance in tests/utils.go was used to get pods using labels.

After this PR:

  • Drop GetPodByVirtualMachineInstance and getPodsByLabel from utils.go.
  • Instead used libpod.GetPodByVirtualMachineInstance for its callers

Fixes #11440

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

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.

Release note

NONE

@kubevirt-bot kubevirt-bot added release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. labels Mar 8, 2024
@kubevirt-bot
Copy link
Contributor

Hi @TheRealSibasishBehera. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

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.

Copy link
Member

@EdDev EdDev left a comment

Choose a reason for hiding this comment

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

The original issue this PR treats needs to be changed.

Please drop GetPodByVirtualMachineInstance from utils.go and replace it in all callers to libpod.GetPodByVirtualMachineInstance that already exists.

tests/utils.go Outdated

return &pods.Items[0]
}

func getPodsByLabel(label, labelType, namespace string) (*k8sv1.PodList, error) {
Copy link
Member

Choose a reason for hiding this comment

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

Is it used now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no it's unused now
should I remove this as well?

Copy link
Member

Choose a reason for hiding this comment

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

Yes

@EdDev
Copy link
Member

EdDev commented Mar 9, 2024

/test pull-kubevirt-build
/test pull-kubevirt-generate

@EdDev
Copy link
Member

EdDev commented Mar 9, 2024

/test all

@EdDev
Copy link
Member

EdDev commented Mar 10, 2024

/sig code-quality

Copy link
Member

@EdDev EdDev left a comment

Choose a reason for hiding this comment

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

Thank you.

Last thing:

  • The commit message line is too long, consider:
 refactor: drop GetPodByVirtualMachineInstance,getPodsByLabel
 
 Use `libpod.GetPodByVirtualMachineInstance` instead at all its callers.
  • PR subject: Please use the same as the commit.

Other than that, LGTM.

Use libpod.GetPodByVirtualMachineInstance instead at all its callers.

Signed-off-by: TheRealSibasishBehera <fangedhamster3114@gmail.com>
@TheRealSibasishBehera TheRealSibasishBehera changed the title refactor: Move getPodsByLabel from tests/utils.go to libpod refactor: drop GetPodByVirtualMachineInstance,getPodsByLabel . Use libpod.GetPodByVirtualMachineInstance instead at all its callers. Mar 10, 2024
Copy link
Member

@EdDev EdDev left a comment

Choose a reason for hiding this comment

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

Thank you.

/test all

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Mar 11, 2024
@kubevirt-bot
Copy link
Contributor

@TheRealSibasishBehera: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-kubevirt-check-tests-for-flakes 838aea4 link false /test pull-kubevirt-check-tests-for-flakes

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.

Copy link
Member

@0xFelix 0xFelix left a comment

Choose a reason for hiding this comment

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

Thanks, looks good!

@EdDev Thanks for taking care of my mixup.

Copy link
Contributor

@enp0s3 enp0s3 left a comment

Choose a reason for hiding this comment

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

/approve

@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: enp0s3

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubevirt-bot kubevirt-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 12, 2024
@kubevirt-commenter-bot
Copy link

Required labels detected, running phase 2 presubmits:
/test pull-kubevirt-e2e-windows2016
/test pull-kubevirt-e2e-kind-1.27-vgpu
/test pull-kubevirt-e2e-kind-sriov
/test pull-kubevirt-e2e-k8s-1.29-ipv6-sig-network
/test pull-kubevirt-e2e-k8s-1.27-sig-network
/test pull-kubevirt-e2e-k8s-1.27-sig-storage
/test pull-kubevirt-e2e-k8s-1.27-sig-compute
/test pull-kubevirt-e2e-k8s-1.27-sig-operator
/test pull-kubevirt-e2e-k8s-1.28-sig-network
/test pull-kubevirt-e2e-k8s-1.28-sig-storage
/test pull-kubevirt-e2e-k8s-1.28-sig-compute
/test pull-kubevirt-e2e-k8s-1.28-sig-operator

@kubevirt-commenter-bot
Copy link

/retest-required
This bot automatically retries required jobs that failed/flaked on approved PRs.
Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

1 similar comment
@kubevirt-commenter-bot
Copy link

/retest-required
This bot automatically retries required jobs that failed/flaked on approved PRs.
Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@kubevirt-bot kubevirt-bot merged commit ebd625c into kubevirt:main Mar 12, 2024
36 of 37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. lgtm Indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. sig/code-quality sig/storage size/M
Projects
None yet
6 participants