Uploaded image for project: 'Red Hat 3scale API Management'
  1. Red Hat 3scale API Management
  2. THREESCALE-11824

Deleting a Product CR in failed state does not delete the product configuration in system

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 2.15.3 GA
    • 3scale Operator
    • False
    • Hide

      None

      Show
      None
    • False
    • Not Started
    • Not Started
    • Not Started
    • Not Started
    • Not Started
    • Not Started

      Description of the issue:

      The 3scale operator does not remove a Product from the system data when the associated custom resource (CR) has an error in its status and it has been deleted.

       

      Steps to reproduce the issue:
      1) create 1 backend and 1 product with the attached `support.yaml` file. The Product is configured with a reference to the backend.
      2) wait for the 3scale operator to synchronize the resources and create the backend and product
      (note that the field `status.productId` exist in the Product CR)
      3) update the Product CR as follows:

      • update `spec.backendUsages.backend_foo` to `spec.backendUsages.backend_non_existent`

      4) After a few moments, the Product CR display the following error in its status:
      ```yaml
      status:
      conditions:

      • lastTransitionTime: "2025-05-05T11:27:37Z"
        message: 'spec.backendUsages[backend_non_existent]: Invalid value: v1beta1.BackendUsageSpec{Path:"/"}:
        backend usage does not have valid backend reference.'
        status: "True"
        type: Failed
      • lastTransitionTime: "2025-05-05T11:26:10Z"
        status: "False"
        type: Invalid
      • lastTransitionTime: "2025-05-05T11:27:37Z"
        message: 'spec.backendUsages[backend_non_existent]: Invalid value: v1beta1.BackendUsageSpec{Path:"/"}:
        backend usage does not have valid backend reference.'
        status: "True"
        type: Orphan
      • lastTransitionTime: "2025-05-05T11:27:37Z"
        status: "False"
        type: Synced
        observedGeneration: 3
        providerAccountHost: https://3scale-[NAMESPACE]-admin.apps.[CLUSTER]
        ```
        This is expected because the reference to the backend is invalid.

      5) Then delete the Product CR.

      The 3scale operator output the logs:
      ```
      {"level":"info","ts":"2025-05-05T11:28:39Z","logger":"controllers.Product","msg":"Reconcile Product","product":

      {"name":"redhat-support","namespace":"[NAMESPACE]"}

      ,"Operator version":"0.12.3"}
      {"level":"info","ts":"2025-05-05T11:28:39Z","logger":"controllers.Product","msg":"could not remove product because ID is missing in status","product":{"name":"redhat-support","namespace":"[NAMESPACE]"}}
      {"level":"info","ts":"2025-05-05T11:28:39Z","logger":"controllers.Product","msg":"Updated object 'v1beta1.Product/redhat-support'"}
      {"level":"info","ts":"2025-05-05T11:28:39Z","logger":"controllers.Product","msg":"Reconcile Product","product":

      {"name":"redhat-support","namespace":"[NAMESPACE]"}

      ,"Operator version":"0.12.3"}
      {"level":"info","ts":"2025-05-05T11:28:39Z","logger":"controllers.Product","msg":"resource not found. Ignoring since object must have been deleted","product":{"name":"redhat-support","namespace":"[NAMESPACE]"}}
      ```

      Note that at this point:

      • the Product CR has been deleted
      • the Product configuration still exist in the API Manager (3scale admin portal still displays that (deleted) product information.
         

      Current Behavior:

      3scale operator allows Product CR deletion that is in a failed state but does not delete the Product configuration along with the CR so after the Product CR is deleted the configuration of that product still remains in the system information and can be observed in the 3scale admin portal -> products.

       

      Expected Behavior:

      3scale operator would either block the Product CR deletion because it is in a failed state, or delete the Product configuration along with the CR.

              Unassigned Unassigned
              rhn-support-icaldero Ivan Calderon Clemente
              An Tran An Tran
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated: