-
Notifications
You must be signed in to change notification settings - Fork 424
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
Set default values in API rather than in webhooks #5111
base: main
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Hi @bryan-cox. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5111 +/- ##
==========================================
- Coverage 51.25% 51.10% -0.16%
==========================================
Files 273 273
Lines 24651 24575 -76
==========================================
- Hits 12636 12558 -78
- Misses 11229 11230 +1
- Partials 786 787 +1 ☔ View full report in Codecov by Sentry. |
@nojnhuh @jackfrancis - do we want to continue with this PR? If so, could I get an ok to test this please? |
/ok-to-test |
/retest |
For pull-cluster-api-provider-azure-e2e-aks
Not sure how these would be empty when they are defaulted here and here. Does the e2e use any API changes from the PR? |
@@ -90,11 +87,8 @@ func (m *AzureManagedControlPlane) setDefaultSubnet() { | |||
if m.Spec.VirtualNetwork.Subnet.Name == "" { | |||
m.Spec.VirtualNetwork.Subnet.Name = m.Name | |||
} | |||
if m.Spec.VirtualNetwork.Subnet.CIDRBlock == "" { |
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.
For pull-cluster-api-provider-azure-e2e-aks
Expected success, but got an error: <errors.aggregate | len:1, cap:1>: admission webhook "validation.azuremanagedcontrolplanes.infrastructure.cluster.x-k8s.io" denied the request: [spec.virtualNetwork.CIDRBlock: Invalid value: "": pre-existing virtual networks CIDR block is invalid, spec.virtualNetwork.Subnet.CIDRBlock: Invalid value: "": pre-existing subnets CIDR block is invalid] [
Not sure how these would be empty when they are defaulted here and here.
Does the e2e use any API changes from the PR?
Webhooks are 100% invoked by the e2e tests. I'm not exactly sure why this specific error is cropping up, but the logic around here seems non-trivial so I'd be okay to omit the CIDR block changes from this PR. My main idea with #4204 was to pick off the low-hanging fruit.
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.
Ok sounds good. I'll put those back.
This commit removes default values previously set in webhooks and adds the default values directly in the API through the kubebuilder annotation, `kubebuilder:default`. Signed-off-by: Bryan Cox <brcox@redhat.com>
@bryan-cox: The following tests failed, say
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-sigs/prow repository. I understand the commands that are listed here. |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
This commit removes default values previously set in webhooks and adds the default values directly in the API through the kubebuilder annotation,
kubebuilder:default
.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 #4204
Special notes for your reviewer:
TODOs:
Release note: