Uploaded image for project: 'OpenShift Console'
  1. OpenShift Console
  2. CONSOLE-4624

Console backend proxy for fetching CRD schema

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Done
    • Icon: Undefined Undefined
    • None
    • None
    • None
    • None
    • None
    • None
    • OCP Console - Sprint 274

      Building upon the PatternFly DataView integration, this story aims to enhance the CRD list page by making its columns configurable. Instead of a static set of columns, the console will now attempt to read the additionalPrinterColumns field from a CRD's spec to determine which columns to display for that specific CRD type. If additionalPrinterColumns are not defined for a CRD, Console will fall back to the currently surfaced default columns.

      To address the scenario where end-users may not have direct RBAC permissions to fetch CRDs (which is necessary to read additionalPrinterColumns), a new Console proxy endpoint will be introduced in the backend. This proxy will fetch CRDs using the Console's elevated RBAC permissions. Correspondingly, the Console-operator's RBAC configuration will need to be updated to grant the Console the necessary permissions to perform these CRD fetches.

       

      AC:

      • A new secure API endpoint is implemented in the Console's backend that can fetch CRD definitions using the Console's RBAC. The Console frontend utilizes this new backend proxy endpoint to retrieve CRD definitions for the purpose of dynamic column discovery. Optionally backend could only return the additionalPrinterColumns field.
        • Add an unit tests
      • The console-operator is updated to grant the Console (via its service account) the necessary RBAC permissions to get and list CustomResourceDefinitions (apiextensions.k8s.io). jhadvig@redhat.com discovered this is not necessary

       

      Technical Notes:

      • Backend:
        • Implement a new REST endpoint (e.g., /api/console/crd-schema) to which we pass the CRD's name and that retrieves CRD definitions. Optionally backend could only return the additionalPrinterColumns field.
        • This endpoint should use the Console's service account to perform Kubernetes API calls (specifically GET/LIST on CustomResourceDefinition resources).
        • Ensure proper error handling and logging in the backend.
      • Console-Operator:
        • Update the ClusterRole associated with the Console's service account to include permissions to get and list customresourcedefinitions.apiextensions.k8s.io.

              rh-ee-leoli Leo Li
              jhadvig@redhat.com Jakub Hadvig
              None
              None
              YaDan Pei YaDan Pei
              None
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: