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

🐛 Fix datastore selection based on StoragePolicy #1937

Merged
merged 1 commit into from
Jul 11, 2023

Conversation

zhanggbj
Copy link
Contributor

@zhanggbj zhanggbj commented Jun 6, 2023

What this PR does / why we need it:

When storage policy is specified, CAPV will fetch compatible datastores and randomly selects one, however the return set also contains datastore cluster. This will leads to long-time retries and even clone failures. Fix it by adding a filter when to get compatible datastores.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

#1914
#1853

Special notes for your reviewer:

Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.

Release note:

Fix datastore selection based on StoragePolicy

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 6, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @zhanggbj. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jun 6, 2023
@zhanggbj zhanggbj changed the title Fix datastore selection based on StoragePolicy 🐛 Fix datastore selection based on StoragePolicy Jun 7, 2023
@yastij yastij removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jun 7, 2023
Copy link
Member

@yastij yastij left a comment

Choose a reason for hiding this comment

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

/approve

pkg/services/govmomi/vcenter/clone.go Show resolved Hide resolved
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: yastij

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 12, 2023
@yastij yastij added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jun 14, 2023
When storage policy is specified, CAPV will fetch compatible datastores
and randomly selects one, however the return set also contains
datastore cluster. This will leads to long-time retries and even clone
failures.

Signed-off-by: Gong Zhang <[email protected]>
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 27, 2023
@zhanggbj
Copy link
Contributor Author

@yastij all tests passed and ready for a review. Thanks!
Also opened #1962 to tracking UT effort.

@zhanggbj
Copy link
Contributor Author

zhanggbj commented Jul 7, 2023

This change is tested locally, and it works well.
It's eady for another review @yastij @vrabbi @srm09, thx!

@randomvariable
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 11, 2023
@k8s-ci-robot k8s-ci-robot merged commit a20c312 into kubernetes-sigs:main Jul 11, 2023
@sbueringer
Copy link
Member

@zhanggbj Should this be backported into v1.7/v1.6/v1.5?

@zhanggbj
Copy link
Contributor Author

@sbueringer Good point! I think yes, just checked code base and this bug already existed since v1.5, so we should backport it.

@sbueringer
Copy link
Member

Thx for checking!

/cherry-pick release-1.7

@sbueringer
Copy link
Member

/cherry-pick release-1.6

@sbueringer
Copy link
Member

/cherry-pick release-1.5

@k8s-infra-cherrypick-robot

@sbueringer: new pull request created: #1999

In response to this:

Thx for checking!

/cherry-pick release-1.7

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.

@k8s-infra-cherrypick-robot

@sbueringer: new pull request created: #2000

In response to this:

/cherry-pick release-1.6

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.

@k8s-infra-cherrypick-robot

@sbueringer: new pull request created: #2001

In response to this:

/cherry-pick release-1.5

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.

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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants