Fix validation of CIDR fields
re https://github.com/kubernetes/kubernetes/issues/134224; isCIDR() allows both "mask-like" CIDRs ("192.168.0.0/24") and "address-like" CIDRs ("192.168.0.5/24"). We only want the former.
(If isCIDR() gets changed, then the extra clause here will just be a no-op, but we'll have better backward-compatibility this way.)
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: danwinship
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~OWNERS~~ [danwinship]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
Deploy Preview for kubernetes-sigs-network-policy-api ready!
| Name | Link |
|---|---|
| Latest commit | e6300dc94760147e200ac79a5e946fb74d1c9324 |
| Latest deploy log | https://app.netlify.com/projects/kubernetes-sigs-network-policy-api/deploys/68f7b18aee17cc0008f28d75 |
| Deploy Preview | https://deploy-preview-324--kubernetes-sigs-network-policy-api.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify project configuration.
uh...
The CustomResourceDefinition "adminnetworkpolicies.policy.networking.k8s.io" is invalid: spec.validation.openAPIV3Schema.properties[spec].properties[egress].items.properties[to].items.properties[networks].items.x-kubernetes-validations[0].rule: Forbidden: estimated rule cost exceeds budget by factor of 1.475000x (try simplifying the rule, or adding maxItems, maxProperties, and maxLength where arrays, maps, and strings are declared)
@tssurya @npinaeva any ideas about how to deal with that CEL cost error? ^^^
@tssurya @npinaeva any ideas about how to deal with that CEL cost error? ^^^
this suggests something is unbounded OR if everything is bounded then yea I remember hitting this error before and I had to play around with the maximum numbers to make it reasonable. IIRC the problem is that we can have 100 egress rules and each rule can have 100 peers and then each peer could be 25 network cidrs.. that's too much? 100x100x25? the only way to fix this is to reduce this number somewhere..
so see if 20 cidr's or 15 fixes this?
I remember I chose 25 cidrs cause back then as well cost exceeded for higher numbers.. :)
uh...
The CustomResourceDefinition "adminnetworkpolicies.policy.networking.k8s.io" is invalid: spec.validation.openAPIV3Schema.properties[spec].properties[egress].items.properties[to].items.properties[networks].items.x-kubernetes-validations[0].rule: Forbidden: estimated rule cost exceeds budget by factor of 1.475000x (try simplifying the rule, or adding maxItems, maxProperties, and maxLength where arrays, maps, and strings are declared)
@tssurya @npinaeva any ideas about how to deal with that CEL cost error? ^^^
this suggests something is unbounded OR if everything is bounded then yea I remember hitting this error before and I had to play around with the maximum numbers to make it reasonable. IIRC the problem is that we can have 100 egress rules and each rule can have 100 peers and then each peer could be 25 network cidrs.. that's too much? 100x100x25? the only way to fix this is to reduce this number somewhere..
so see if 20 cidr's or 15 fixes this?
I remember I chose 25 cidrs cause back then as well cost exceeded for higher numbers.. :)
@jpbetz @cici37 any best practices or guidelines we can follow here?
/lgtm
https://github.com/kubernetes/kubernetes/issues/120973#issuecomment-3381265267
New changes are detected. LGTM label has been removed.
will rebasing help since https://github.com/kubernetes-sigs/network-policy-api/pull/329 merged?
@danwinship: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:
| Test name | Commit | Details | Required | Rerun command |
|---|---|---|---|---|
| pull-network-policy-api-crd-e2e | e6300dc94760147e200ac79a5e946fb74d1c9324 | link | true | /test pull-network-policy-api-crd-e2e |
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.