Skip to content

Add CEL validation tests for CRDs#383

Open
TheBeeZee wants to merge 1 commit into
kubernetes-sigs:mainfrom
TheBeeZee:crd-validation-tests
Open

Add CEL validation tests for CRDs#383
TheBeeZee wants to merge 1 commit into
kubernetes-sigs:mainfrom
TheBeeZee:crd-validation-tests

Conversation

@TheBeeZee

@TheBeeZee TheBeeZee commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Adds test cases under pkg/crdtest/testdata/ to verify CEL validation rules for ClusterNetworkPolicy (v1alpha2):

  • Valid/Invalid CIDRs: Verifies IPv4/IPv6 CIDR format validation.
  • Port Ranges: Verifies that start < end constraint is enforced (e.g., rejecting 80-80).
  • Egress Constraints (Experimental): Verifies mutual exclusion between egress peers (egress.to) and destination named ports.
    • Note: Experimental test cases (named *.experimental.yaml) are automatically skipped by default when running against standard CRDs, as the validation rules are not present.

Fixes: #148

@netlify

netlify Bot commented Jun 17, 2026

Copy link
Copy Markdown

Deploy Preview for kubernetes-sigs-network-policy-api ready!

Name Link
🔨 Latest commit bfe9bb1
🔍 Latest deploy log https://app.netlify.com/projects/kubernetes-sigs-network-policy-api/deploys/6a3316b0c95c4b0008f66082
😎 Deploy Preview https://deploy-preview-383--kubernetes-sigs-network-policy-api.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@k8s-ci-robot k8s-ci-robot requested review from aojea and danwinship June 17, 2026 21:50
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 17, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

Hi @TheBeeZee. 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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

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.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 17, 2026
@danwinship

Copy link
Copy Markdown
Contributor

Regular contributors should join the org to skip this step.

(You can get kubernetes-sigs membership even if you're not eligible for kubernetes membership too; see further down on the same page.)

@danwinship

Copy link
Copy Markdown
Contributor

/ok-to-test
/approve

I'll leave it for someone else to lgtm.

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 18, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: danwinship, TheBeeZee

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Validation unit tests for the APIs

3 participants