Skip to content

Expand Kubernetes examples for multiple categories of CEL use #41

@liggitt

Description

@liggitt

Feature Description

The existing Kubernetes examples in the drop-down are really nice, but CEL is supported in multiple contexts in Kubernetes, which have their own distinct inputs, documentation, and expected return types:

  1. CRD validation rules
    • self / oldSelf variables contain data
    • boolean return value is expected
  2. Admission webhook matchConditions and ValidatingAdmissionPolicy expressions
    • object / oldObject variables contain data, request..., params, namespaceObject variables contain metadata, authorizer variable allows access to authorization functions
    • boolean return value is expected
  3. OIDC claim mapping and user validation rules (new in 1.29, configured via file in kube-apiserver arg, design, in-progress docs)
    • claims variable contains claim data for validation (boolean return value) or extracting (string / string array return value, depending on the context)
    • user variable contains user info for validation
    • boolean return value is expected
  4. Authorization matchConditions (new in 1.29, configured via file in kube-apiserver arg, design, in-progress docs)
    • request variable contains SubjectAccessReview data
    • boolean return value is expected

The existing examples could be even more useful with some additions:

  1. examples per category
  2. links to docs for that category
  3. access to functions (like authorizer) with mocked return values available to that category
  4. type checking of the expected return value(s) for that category

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions