Uploaded image for project: 'Hybrid Cloud Console'
  1. Hybrid Cloud Console
  2. RHCLOUD-27445

Sources UI missing cluster-id for CostManagementMetricsOperator-created sources

XMLWordPrintable

    • False
    • Hide

      None

      Show
      None
    • False
    • Unset
    • No
    • PlatEx UI Sprint 9

      The CostManagementMetricsOperator can create OCP sources via the API. The operator uses a relatively old API flow, but the source creation and integration with cost-management works just fine. However, the cluster-id for those sources is missing in the Sources UI.

      Attached are 2 screenshots of the Sources UI, mskarbek - ocp was created via the console-dot UI, and mskarbek - ocp2 was created via the cost-management operator. Notice the missing cluster-id for mskarbek - ocp2.

      Here are various API responses for these sources. In the /api/sources/v1/sources/ endpoint, the cluster-id is stored in the source_ref field:

      https: //console.redhat.com/api/sources/v1/sources/
      [
          {
              "availability_status": "available",
              "id": "456169",
              "created_at": "2023-07-31T15:19:10Z",
              "updated_at": "2023-07-31T15:19:13Z",
              "name": "mskarbek - ocp",
              "uid": "d6abc3af-1827-41eb-9d8f-18aa7076925c",
              "source_ref": "00000000-7777-4444-bbbb-eeeeeeeeeeee",
              "app_creation_workflow": "manual_configuration",
              "source_type_id": "1"
          },
          {
              "availability_status": "available",
              "id": "456243",
              "created_at": "2023-07-31T20:51:40Z",
              "updated_at": "2023-07-31T20:51:42Z",
              "name": "mskarbek - ocp2",
              "uid": "825f951d-4e6d-4fc7-8099-fbfc79f93867",
              "source_ref": "82534199-d0f7-4711-80e2-4af9e9aaf876",
              "app_creation_workflow": "manual_configuration",
              "source_type_id": "1"
          }
      ]
      
      https: //console.redhat.com/api/sources/v1/applications/
      [
          {
              "id": "413006",
              "created_at": "2023-07-31T15:19:10Z",
              "updated_at": "2023-07-31T15:20:42Z",
              "availability_status": "available",
              "extra": {
                  "hcs": false
              },
              "source_id": "456169",
              "application_type_id": "2"
          },
          {
              "id": "413066",
              "created_at": "2023-07-31T20:51:40Z",
              "updated_at": "2023-07-31T20:52:44Z",
              "availability_status": "available",
              "source_id": "456243",
              "application_type_id": "2"
          }
      ]
      
      https: //console.redhat.com/api/sources/v1/authentications/
      {
          "id": "497712",
          "authtype": "token",
          "username": "",
          "availability_status": "in_progress",
          "resource_type": "Application",
          "resource_id": "413006"
      }
      

      The operator does not send an Authentication POST request, so it does not have a corresponding authentications entry.

       

      The UI should be updated to always display the cluster-id for an OCP source. This cluster-id should not be editable through the UI for an operator created source.

            fhlavac Filip Hlavac
            mskarbek Michael Skarbek
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: