Repository navigation
Document selector length and nesting limits - #3201
Conversation
Selectors are limited to 100 levels of nested parentheses (projectcalico/calico#14327, tigera/calico-private#14649 and picks). Selector fields are limited to 1024 characters by convention.
✅ Deploy Preview succeeded!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for calico-docs-preview-next ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
🟢 Approval recommended
The reviewed changes consistently document selector length and nesting limits across the relevant current and supported versioned documentation, with no unresolved concerns identified.
No open issues 🎉
What changed in this PR
Documents selector length and parenthesis-nesting limits across current and supported versioned Calico documentation.
Changes:
- Adds the 1024-character selector field limit to shared selector fragments.
- Documents the maximum parenthesis nesting depth as 100.
- Adds release-specific availability markers for supported versioned documentation.
| File | Description |
|---|---|
| calico/_includes/content/_selectors.mdx | Adds selector length and nesting limits to current Calico Open Source documentation. |
| calico-enterprise/_includes/content/_selectors.mdx | Adds selector length and nesting limits to current Calico Enterprise documentation. |
| calico-enterprise_versioned_docs/version-3.23-2/_includes/content/_selectors.mdx | Documents selector limits introduced in Calico Enterprise v3.23.3. |
| calico-enterprise_versioned_docs/version-3.22-2/_includes/content/_selectors.mdx | Documents selector limits introduced in Calico Enterprise v3.22.9. |
| calico-cloud/_includes/content/_selectors.mdx | Adds selector length and nesting limits to current Calico Cloud documentation. |
| calico_versioned_docs/version-3.33/_includes/content/_selectors.mdx | Documents selector limits introduced in Calico Open Source v3.33.1. |
| calico_versioned_docs/version-3.32/_includes/content/_selectors.mdx | Documents selector limits introduced in Calico Open Source v3.32.4. |
Review effort: Lite
ctauchen
left a comment
There was a problem hiding this comment.
LGTM with suggestions.
| - Has a value for `my-label` that starts with "prod", and, | ||
| - Has a role label with value either "frontend", or "business". | ||
|
|
||
| By convention, the $[prodname] API limits selector fields to 1024 characters. |
There was a problem hiding this comment.
"By convention" makes this sound like a guideline. What happens when a selector is longer than 1024 characters, or nested deeper than 100? If the API server rejects it, say so: "Selectors can be at most 1024 characters long, with parentheses nested at most 100 deep. Longer or deeper selectors are rejected." If something else happens, such as Felix ignoring the policy, users need to know that most.
This applies to all seven copies.
There was a problem hiding this comment.
Claude: Both limits are enforced: the API server rejects a selector over 1024 characters or nested more than 100 deep. For a resource already stored with a selector nested too deep, Felix treats the resource as missing and logs a warning. The copies now say: "Selectors can be at most 1024 characters long, with parentheses nested at most 100 deep. The API server rejects longer or deeper selectors. If a stored resource has a selector nested more than 100 deep, Felix ignores the resource and logs a warning." Enterprise 3.22-2 and 3.23-2 got the nesting limit but not the change that put the 1024-character limit on every selector field, so those two copies state only the nesting limit.
| - Has a value for `my-label` that starts with "prod", and, | ||
| - Has a role label with value either "frontend", or "business". | ||
|
|
||
| By convention, the $[prodname] API limits selector fields to 1024 characters. |
There was a problem hiding this comment.
Timing: the 3.32 and 3.33 copies describe 3.32.4 and 3.33.1, which haven't shipped. Could we hold those two files until the publish PRs land? The OSS 3.32.4 one is #3194.
There was a problem hiding this comment.
Claude: Done: I took the 3.32 and 3.33 copies out of this PR. They're on the shaun/selector-limits-oss-patches branch, ready to open once the v3.32.4 publish PR (#3194) and the v3.33.1 one land.
…opies The 3.32 and 3.33 copies move to a follow-up branch until v3.32.4 and v3.33.1 are published.

Product Version(s):
Release dates are as of Nov 11, 2026.
The Calico Open Source 3.32 and 3.33 copies are held back until v3.32.4 (publish PR #3194) and v3.33.1 (planned Nov 18) are published. They're on the
shaun/selector-limits-oss-patchesbranch.Issue:
MaxLength=1024on the selector fields that lacked it.Link to docs preview:
SME review:
DOCS review:
Additional information:
Adds the selector limits to the shared selectors fragment, and what happens past them:
felix/calc/validation_filter.go).Enterprise 3.22-2 and 3.23-2 got the nesting limit (shipped in v3.22.9 and v3.23.3) but not the change that put
MaxLength=1024on every selector field, so those two copies state only the nesting limit.Calico Enterprise 3.21-2, 3.24-1 and 3.24-2, and Calico Open Source 3.31, didn't get the change, so they're unchanged.
Merge checklist: