Uploaded image for project: 'Cost Management'
  1. Cost Management
  2. COST-4947

OCP provider cloud infrastructure update can fail

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • 2024-May-08
    • None
    • None
    • None
    • 5
    • False
    • None
    • False

      If a OpenShift Cluster is created and associated with a cloud provider that has an existing infrastructure with a different region/account, the provider will not be updated to include the infrastructure resulting in OCP on Cloud summary not triggering.

      This happens because we now get a region and account during provider infra map sql so when we call get or create and include those fields, django attempts to create a new object but since ProviderInfrastructureMap is unique on infrastructure_provider and infrastructure_type it fails. We catch this error and attempt to filter for the record but since the existing record for that infrastructure_provider and infrastructure_type does not have the same region and account, the filter finds no objects and we do not pass back an infrastructuremap object to update the provider with.

      Relevant code locations:

      1. OCP Infrastructure Map SQL
      2. Object Creation for ProviderInfrastructureMap
      3. DB Model for ProviderInfrastructureMap

       

      Relevant slack conversation: https://redhat-internal.slack.com/archives/C04476G1F7H/p1713304769444639 

            cgoodfre Corey Goodfred
            cgoodfre Corey Goodfred
            Daniel Chorvatovic Daniel Chorvatovic
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: