-
Notifications
You must be signed in to change notification settings - Fork 101
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
🌱 remove kubebuilder:default=true for CloudProviderEnabled and set defaults in defaulting webhook #2276
🌱 remove kubebuilder:default=true for CloudProviderEnabled and set defaults in defaulting webhook #2276
Conversation
bdeeef6
to
005857d
Compare
/test ? |
@Sunnatillo: The following commands are available to trigger required jobs:
The following commands are available to trigger optional jobs:
Use
In response to this:
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-sigs/prow repository. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/test metal3-centos-e2e-integration-test-main metal3-ubuntu-e2e-integration-test-main |
Actual test need to be done via test PR in dev-env, targeting this branch. /cc @kashifest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO this seems fine.
/approve |
It is still not clear to me what issue is it solving, and why the current way of setting the default using kubebuilder tag is an issue, can you describe the issue in a bit more detail ? |
i have updated the description of this PR and also the previous PR please check. |
Thanks a lot. We had offline discussion as well to clear the issue out. /approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: elfosardo, kashifest 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 |
/retest |
Needs rebase on top of #2277 after that has merged. |
Signed-off-by: Muhammad Adil Ghaffar <[email protected]>
005857d
to
6ebd717
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/test metal3-centos-e2e-integration-test-main metal3-ubuntu-e2e-integration-test-main |
What this PR does / why we need it:
Instead of using
// +kubebuilder:default=true
to set a default value forCloudProviderEnabled
, we are configuring defaults through a defaulting webhook. This approach avoids conflicts with theNoCloudProvider
field in the validation webhook.Using
kubebuilder:default
makes it impossible to distinguish whether the value ofCloudProviderEnabled
was explicitly set by the user or automatically assigned by the default. This distinction is critical because our validation webhook ensures thatCloudProviderEnabled
andNoCloudProvider
do not conflict when both are set. If we rely onkubebuilder:default
, the validation webhook cannot function as intended, as it cannot determine the source of theCloudProviderEnabled
value. By shifting defaulting logic to the webhook, we retain the ability to enforce these validation rules effectively.This PR is a follow-up of this PR: #2108
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 #