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: upgrade nodepool crd to v1beta2 #2266

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tnsimon
Copy link
Contributor

@tnsimon tnsimon commented Jan 10, 2025

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespace from that line:
/kind feature

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #2258

Special notes for your reviewer:

/assign @rambohe-ch

Does this PR introduce a user-facing change?

Adds updated CRD Nodepool v1beta2 as per https://github.com/openyurtio/openyurt/blob/master/docs/proposals/20241211-reuse-nodepool-list-watch-requests.md#api-changes

other Note

@tnsimon tnsimon requested a review from a team as a code owner January 10, 2025 03:21
@tnsimon tnsimon force-pushed the add-nodepool-v1beta2 branch from 4f8c2ca to 39c82bc Compare January 10, 2025 03:35
Copy link

codecov bot commented Jan 10, 2025

Codecov Report

Attention: Patch coverage is 44.34783% with 64 lines in your changes missing coverage. Please review.

Project coverage is 45.19%. Comparing base (9ba1d5e) to head (5df865a).

Files with missing lines Patch % Lines
pkg/apis/apps/v1beta1/nodepool_conversion.go 0.00% 32 Missing ⚠️
...er/webhook/nodepool/v1beta2/nodepool_validation.go 69.56% 12 Missing and 2 partials ⚠️
pkg/yurtmanager/webhook/server.go 0.00% 6 Missing ⚠️
pkg/apis/apps/v1alpha1/nodepool_conversion.go 0.00% 5 Missing ⚠️
pkg/apis/apps/v1beta2/default.go 0.00% 3 Missing ⚠️
pkg/apis/apps/v1beta2/groupversion_info.go 0.00% 2 Missing ⚠️
pkg/apis/apps/v1beta2/nodepool_conversion.go 0.00% 1 Missing ⚠️
...nager/webhook/nodepool/v1beta2/nodepool_handler.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2266   +/-   ##
=======================================
  Coverage   45.18%   45.19%           
=======================================
  Files         422      427    +5     
  Lines       28779    28868   +89     
=======================================
+ Hits        13005    13046   +41     
- Misses      14460    14507   +47     
- Partials     1314     1315    +1     
Flag Coverage Δ
unittests 45.19% <44.34%> (+<0.01%) ⬆️

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.

type: object
type: object
served: true
storage: true
Copy link
Member

Choose a reason for hiding this comment

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

Yes, I will configure v1beta2 as storage for NodePool, so we need to modify v1beta1 storage to false.

// +kubebuilder:storageversion

*/

// Hub marks this type as a conversion hub.
func (*NodePool) Hub() {}
Copy link
Member

Choose a reason for hiding this comment

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

We need improve v1beta1.NodePool conversion, because v1beta2.NodePool will be used as storage. this means that v1beta1.NodePool should implement ConvertTo and ConvertFrom function for converting between v1beta1 and v1beta2.

)

// SetupWebhookWithManager sets up Cluster webhooks. mutate path, validatepath, error
func (webhook *NodePoolHandler) SetupWebhookWithManager(mgr ctrl.Manager) (string, string, error) {
Copy link
Member

Choose a reason for hiding this comment

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

we can remove webhook of nodepool/v1beta1, and keep nodepool/v1beta2 webhook only.

@tnsimon tnsimon force-pushed the add-nodepool-v1beta2 branch from a01256d to 5df865a Compare January 15, 2025 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feature request]upgrade NodePool CRD to v1beta2
2 participants