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

🌱 hack/tools/janitor also cleanup child resource pools and folders for capv #2870

Merged

Conversation

chrischdi
Copy link
Member

What this PR does / why we need it:

Adds functionality to hack/tools/janitor:

  • Delete created child folders (get created during supervisor tests)
  • Delete created child resource pools (get created during supervisor tests)
  • Unit test coverage for janitor

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 #

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Apr 2, 2024
@k8s-ci-robot k8s-ci-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Apr 2, 2024
Copy link

codecov bot commented Apr 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 64.01%. Comparing base (f9fd1a9) to head (b642613).
Report is 41 commits behind head on main.

❗ Current head b642613 differs from pull request most recent head 0681f92. Consider uploading reports for the commit 0681f92 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2870      +/-   ##
==========================================
+ Coverage   63.89%   64.01%   +0.11%     
==========================================
  Files         160      160              
  Lines        9375     9367       -8     
==========================================
+ Hits         5990     5996       +6     
+ Misses       2923     2913      -10     
+ Partials      462      458       -4     

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

@chrischdi
Copy link
Member Author

/retest

Copy link
Contributor

@zhanggbj zhanggbj left a comment

Choose a reason for hiding this comment

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

Just some nits :-)

hack/tools/janitor/main.go Outdated Show resolved Hide resolved
hack/tools/janitor/main.go Show resolved Hide resolved
hack/tools/janitor/vsphere.go Outdated Show resolved Hide resolved
hack/tools/janitor/vsphere.go Outdated Show resolved Hide resolved
hack/tools/janitor/main.go Show resolved Hide resolved
hack/tools/janitor/janitor.go Show resolved Hide resolved
hack/tools/janitor/janitor.go Show resolved Hide resolved
hack/tools/janitor/janitor_test.go Outdated Show resolved Hide resolved
hack/tools/janitor/janitor_test.go Outdated Show resolved Hide resolved
hack/tools/janitor/janitor_test.go Show resolved Hide resolved
@fabriziopandini
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 Apr 4, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 9da717e5d40e901b30c0816153d11914936bcfbc

@sbueringer sbueringer added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Apr 8, 2024
Copy link
Member

@sbueringer sbueringer left a comment

Choose a reason for hiding this comment

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

Really nice work. I especially appreciate the extensive test coverage.

I know that code that uses govmomi has a tendency to become relatively cryptic pretty fast. Let's please try to keep it as easily readable as possible (godoc, good variable names, ...)

hack/tools/janitor/janitor.go Outdated Show resolved Hide resolved
hack/tools/janitor/janitor.go Outdated Show resolved Hide resolved
hack/tools/janitor/janitor.go Show resolved Hide resolved
hack/tools/janitor/main.go Outdated Show resolved Hide resolved
hack/tools/janitor/janitor.go Outdated Show resolved Hide resolved
hack/tools/janitor/vsphere.go Show resolved Hide resolved
hack/tools/janitor/vsphere.go Show resolved Hide resolved
hack/tools/janitor/janitor_test.go Outdated Show resolved Hide resolved
hack/tools/janitor/janitor_test.go Outdated Show resolved Hide resolved
hack/tools/janitor/janitor_test.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 8, 2024
@sbueringer
Copy link
Member

Thank you very much!

Let's finish the discussion here: #2870 (comment)

But I think we're good

/lgtm

/assign @fabriziopandini

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

LGTM label has been added.

Git tree hash: d949bdf92b4c83b52a39c7385792540a8cb2a1b6

@fabriziopandini
Copy link
Member

/approve

Great work
Let's keep an eye on the next few days, so can improve / refine if necessary

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fabriziopandini

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 Apr 9, 2024
@k8s-ci-robot k8s-ci-robot merged commit 78666b5 into kubernetes-sigs:main Apr 9, 2024
17 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.10 milestone Apr 9, 2024
@chrischdi chrischdi deleted the pr-janitor-rp-and-folders branch April 9, 2024 13:33
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/XL Denotes a PR that changes 500-999 lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants