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

🐛 Improve clustermodule existence check #2535

Merged

Conversation

rikatz
Copy link
Contributor

@rikatz rikatz commented Dec 8, 2023

What this PR does / why we need it:
NodeAntiAffinity uses an api called clustermodules. This API does not have a "GET" operation, which means that checking it existence needs to do a list and iterate over this list, being an expensive operation.

But the "membership" API, part of clustermodules does have a Get members that, in case of the clustermodule not existing, will throw a 404 error.

Using this check instead may help improving the usage of clustermodules on large environments.

Note from Ricardo I'm testing this PR locally on a place I have found this to be a problem :) Will post more information soon - This works really fine and the consumption of rest endpoint has felt a lot!

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Dec 8, 2023
@k8s-ci-robot k8s-ci-robot requested review from vrabbi and yastij December 8, 2023 20:34
@rikatz rikatz changed the title Improve clustermodule existence check 🐛 Improve clustermodule existence check Dec 10, 2023
@sbueringer
Copy link
Member

/hold

Just to merge the logging PR first

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 11, 2023
Copy link

codecov bot commented Dec 11, 2023

Codecov Report

Attention: 6 lines in your changes are missing coverage. Please review.

Comparison is base (83f9509) 63.59% compared to head (94356e1) 63.83%.
Report is 9 commits behind head on main.

Files Patch % Lines
pkg/services/govmomi/clustermodules/provider.go 54.54% 4 Missing and 1 partial ⚠️
pkg/services/govmomi/service.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2535      +/-   ##
==========================================
+ Coverage   63.59%   63.83%   +0.24%     
==========================================
  Files         120      119       -1     
  Lines        8685     8678       -7     
==========================================
+ Hits         5523     5540      +17     
+ Misses       2735     2718      -17     
+ Partials      427      420       -7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rikatz
Copy link
Contributor Author

rikatz commented Dec 11, 2023

ok, will wait for a new govmomi version to bump here :)

@sbueringer
Copy link
Member

/hold cancel

logging PR is merged

@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Dec 12, 2023
@rikatz rikatz force-pushed the check-clustermodules-queries branch 2 times, most recently from 60a02dd to 2b1b1aa Compare December 12, 2023 20:02
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 12, 2023
@rikatz
Copy link
Contributor Author

rikatz commented Dec 13, 2023

/hold
Will bump https://github.com/vmware/govmomi/releases/tag/v0.34.0 tomorrow and use new error check util func

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 13, 2023
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Dec 13, 2023
@rikatz
Copy link
Contributor Author

rikatz commented Dec 13, 2023

all done, I've kept the commits separated to easy the review, let me know when to squash it :)

@rikatz rikatz force-pushed the check-clustermodules-queries branch from 4a6683d to 3299124 Compare December 13, 2023 12:59
@sbueringer
Copy link
Member

@rikatz rikatz force-pushed the check-clustermodules-queries branch from 3299124 to 4016141 Compare December 13, 2023 13:21
@rikatz
Copy link
Contributor Author

rikatz commented Dec 13, 2023

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 13, 2023
@rikatz rikatz force-pushed the check-clustermodules-queries branch from 4016141 to 94356e1 Compare December 13, 2023 13:28
@sbueringer
Copy link
Member

/approve

/assign @chrischdi
for final review

@rikatz Would be probably nice to cherry-pick into 1.8 / 1.7?

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 13, 2023
@sbueringer
Copy link
Member

/test pull-cluster-api-provider-vsphere-e2e-full-main

@rikatz
Copy link
Contributor Author

rikatz commented Dec 13, 2023

@sbueringer yeah, on my side we are using CAPV 1.8 so would be great, but also I'm happy to cherrypick to v1.7 (if everything fails here due to rebases, I can do it manually!)

Copy link
Member

@chrischdi chrischdi left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 13, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: c3e8ed5603204716376ec0a0895599ad6e7f6912

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: chrischdi, sbueringer

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:
  • OWNERS [chrischdi,sbueringer]

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

@sbueringer
Copy link
Member

sbueringer commented Dec 13, 2023

Sounds good, thank you!

I think automatic cherry-pick will fail because of the logging changes (I think you had to rebase after the logging PR was merged)

@chrischdi
Copy link
Member

/retest

@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Dec 13, 2023

@rikatz: 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-cluster-api-provider-vsphere-apidiff-main 94356e1 link false /test pull-cluster-api-provider-vsphere-apidiff-main

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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.

@k8s-ci-robot k8s-ci-robot merged commit fe8f55c into kubernetes-sigs:main Dec 13, 2023
13 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.9 milestone Dec 13, 2023
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. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants