Uploaded image for project: 'Percona Operator for MongoDB'
  1. Percona Operator for MongoDB
  2. K8SPSMDB-684

Generate OpenAPI schema for CRD and validate CR

Details

    • Improvement
    • Status: Done
    • Medium
    • Resolution: Fixed
    • None
    • 1.12.0
    • None
    • None
    • Yes

    Description

      While fixing K8SPSMDB-540 we started generating OpenAPI scheme to register our fields and their types to Kubernetes API, so it can provide validation for our custom resources.
      That means it's not just about resources but now we have validation for every other field.

      Now we have a script in `e2e-tests/manifest`. It uses `controller-gen` so it should be installed to generate the CRD. From now `deploy/crd.yaml` shouldn't be edited by hand. We need to run `e2e-tests/manifest` after we add new fields to API.

      `--server-side` apply option needs to be used to workaround the limitation of file size. If conflicts with server side apply are seen users will need to use `--force-conflicts`.

      Attachments

        Activity

          People

            dmytro.zghoba Dmytro Zghoba
            tomislav.plavcic@percona.com Tomislav Plavcic
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Smart Checklist