docs icon indicating copy to clipboard operation
docs copied to clipboard

Figure out what OAPI and Kubernetes CEL stuff should be covered in XRD docs

Open plumbis opened this issue 2 years ago • 0 comments

What's Missing?

https://kubernetes.io/blog/2022/09/29/enforce-immutability-using-cel/#generated-schema

We can make XRD fields immutable using the CEL stuff for CRDs.

Example in an XRD

  versions:
    - name: v1alpha1
      served: true
      referenceable: true
      schema:
        openAPIV3Schema:
          type: object
          properties:
            spec:
              type: object
              properties:
                someData:
                  type: object
                  properties:
                    myField:
                      items:
                        type: string
                      type: array
                      x-kubernetes-validations:
                      - message: Value is immutable
                        rule: self == oldSelf

Trying to update the field will produce an error.

plumbis avatar Aug 10 '23 19:08 plumbis