-
Notifications
You must be signed in to change notification settings - Fork 198
Add CEL Validation to Existing Union Types #4247
Copy link
Copy link
Closed
Copy link
Labels
enhancementNew feature or requestNew feature or requestkubernetesItems related to KubernetesItems related to Kubernetesoperatorsize/SSmall PR: 100-299 lines changedSmall PR: 100-299 lines changed
Description
As a platform operator,
I want OIDCConfigRef and AuthzConfigRef to reject invalid combinations at admission time,
so that misconfigurations are caught immediately by the API server instead of surfacing as confusing controller errors.
Size: S
Dependencies: None
Labels: operator, api
Context
OIDCConfigRef uses a type discriminator field (kubernetes, configMap, inline) but has no CEL validation rules — nothing prevents setting both configMap and inline simultaneously. AuthzConfigRef has the same gap. Validation only happens at controller reconciliation time, producing confusing error conditions instead of immediate API rejection.
Compare with MCPExternalAuthConfig which already has CEL rules (mcpexternalauthconfig_types.go:44-51).
Acceptance Criteria
-
OIDCConfigRefhas CEL rules enforcing that the populated field matches thetypediscriminator (kubernetes,configMap,inline) -
AuthzConfigRefhas CEL rules enforcing that the populated field matches thetypediscriminator (configMap,inline) - Applying a manifest with a type/field mismatch (e.g.,
type: kubernetesbutconfigMapset) is rejected by the API server - Applying a manifest with neither set is rejected by the API server
- Existing valid manifests continue to work unchanged
- Unit tests cover all valid/invalid combinations
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestkubernetesItems related to KubernetesItems related to Kubernetesoperatorsize/SSmall PR: 100-299 lines changedSmall PR: 100-299 lines changed