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

feat: addon support clean sub-resource of multi-versions #512

Merged
merged 8 commits into from
Dec 13, 2024

Conversation

yipeng1030
Copy link
Contributor

@yipeng1030 yipeng1030 commented Dec 5, 2024

fix #441

usage:
add a cmd kbcli addon delete-resources-with-version [addonName] --versions= or --all-unused-versions=

example:
kbcli addon delete-resources-with-version postgresql --versions=0.9.1
kbcli addon delete-resources-with-version postgresql --all-unused-versions=true

effect:
clean resources which are belong to the specified addon, and not the newest version defined in the helm release, and not currently used by any cluster.
By far, the reource type will be checked and cleaned are types.CompDefGVR(), types.ConfigmapGVR(), types.ConfigConstraintGVR(), types.ConfigConstraintOldGVR(),

@github-actions github-actions bot added the size/L Denotes a PR that changes 100-499 lines. label Dec 5, 2024
@yipeng1030 yipeng1030 changed the title feature: addon uninstall support clean sub-resource of multi-versions feat: addon uninstall support clean sub-resource of multi-versions Dec 5, 2024
@yipeng1030 yipeng1030 force-pushed the feature/addon_uninstall_support_subresource branch from e1a9b63 to 5b08751 Compare December 5, 2024 11:59
@codecov-commenter
Copy link

codecov-commenter commented Dec 5, 2024

Codecov Report

Attention: Patch coverage is 58.37838% with 77 lines in your changes missing coverage. Please review.

Project coverage is 41.31%. Comparing base (0fd532e) to head (2bbd7da).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
pkg/cmd/addon/delete_resource.go 67.72% 34 Missing and 17 partials ⚠️
pkg/cmd/addon/uninstall.go 0.00% 26 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #512      +/-   ##
==========================================
+ Coverage   41.16%   41.31%   +0.14%     
==========================================
  Files         185      186       +1     
  Lines       24356    24540     +184     
==========================================
+ Hits        10026    10138     +112     
- Misses      13183    13238      +55     
- Partials     1147     1164      +17     
Flag Coverage Δ
unittests 41.31% <58.37%> (+0.14%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@yipeng1030 yipeng1030 marked this pull request as draft December 6, 2024 11:42
@yipeng1030 yipeng1030 changed the title feat: addon uninstall support clean sub-resource of multi-versions feat: addon support clean sub-resource of multi-versions Dec 6, 2024
@yipeng1030 yipeng1030 force-pushed the feature/addon_uninstall_support_subresource branch from 93fbbdd to 68919d7 Compare December 9, 2024 03:03
@yipeng1030 yipeng1030 force-pushed the feature/addon_uninstall_support_subresource branch from f47f081 to b766150 Compare December 9, 2024 06:46
@yipeng1030 yipeng1030 marked this pull request as ready for review December 9, 2024 08:20
@github-actions github-actions bot added size/XL Denotes a PR that changes 500-999 lines. and removed size/L Denotes a PR that changes 100-499 lines. labels Dec 9, 2024
pkg/cmd/addon/delete_resource.go Outdated Show resolved Hide resolved
pkg/cmd/addon/delete_resource.go Outdated Show resolved Hide resolved
pkg/cmd/addon/delete_resource.go Show resolved Hide resolved
pkg/cmd/addon/delete_resource.go Show resolved Hide resolved
@yipeng1030
Copy link
Contributor Author

yipeng1030 commented Dec 11, 2024

By far, the resource types which should be checked and cleaned are types.CompDefGVR(), types.ConfigmapGVR(), types.ConfigConstraintGVR(), types.ConfigConstraintOldGVR().
Maybe some types need to add after configuration 1.0 API refactored.

@yipeng1030 yipeng1030 merged commit e18cf6b into main Dec 13, 2024
12 checks passed
@yipeng1030 yipeng1030 deleted the feature/addon_uninstall_support_subresource branch December 13, 2024 07:21
@github-actions github-actions bot added this to the Release 1.0 milestone Dec 13, 2024
@yipeng1030
Copy link
Contributor Author

/cherry-pick release-1.0

@apecloud-bot
Copy link
Collaborator

🤖 says: ‼️ cherry pick action failed.
See: https://github.com/apecloud/kbcli/actions/runs/12311352311

@yipeng1030
Copy link
Contributor Author

/cherry-pick release-1.0

@apecloud-bot
Copy link
Collaborator

🤖 says: cherry pick action finished successfully 🎉!
See: https://github.com/apecloud/kbcli/actions/runs/12311367606

apecloud-bot pushed a commit that referenced this pull request Dec 13, 2024
Co-authored-by: yipeng1030 <[email protected]>
(cherry picked from commit e18cf6b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/XL Denotes a PR that changes 500-999 lines.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Features] kbcli supports addons some CRs multi versions resources clean
4 participants