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

Applications being duplicated when 3scale Operator fails to reconcile Product

XMLWordPrintable

    • False
    • None
    • False
    • Not Started
    • Not Started
    • Not Started
    • Not Started
    • Not Started
    • Not Started
    • RHOAM Sprint 67

      Issue description:

      In 3scale 2.14, if 3scale Operator (tested with version 0.11.11) is uninstalled and then reinstalled but is unable to connect to the Admin Portal due to a self-signed or invalid certificate, it will cause any application CRs to enter an error state with the applicationID field removed from the Application CR. Thus, after correcting the certificate issue in the operator, it will ultimately create a duplicate application .

      How to reproduce:

      1. Create a developersecret.yaml, developeruser.yaml, developeraccount.yaml, product.yaml and a application.yaml;
      2. Wait for operator to sync all CR's, and check the assigned applicationID of application:
      $ oc get application/testapplication -o yaml
      apiVersion: capabilities.3scale.net/v1beta1
      kind: Application
      ...
      status:
        applicationID: 10
        conditions:
        - lastTransitionTime: "2024-05-01T17:08:36Z"
          status: "True"
          type: Ready
        observedGeneration: 2
        providerAccountHost: https://3scale-admin.apps.example.com
        state: live
      
      1. Checking in Admin Portal, we can see the created application in the product:
      2. Remove and reinstall the 3scale Operator;
      3. Wait for operator to start and check the application status:
      $ oc get application/testapplication -o yaml
      apiVersion: capabilities.3scale.net/v1beta1
      kind: Application
      ...
      status:
        conditions:
        - lastTransitionTime: "2024-05-01T17:16:30Z"
          message: 'spec.productCRName: Invalid value: v1.LocalObjectReference{Name:"testproduct"}:
            productCR name doesnt have a valid product reference'
          status: "False"
          type: Ready
        observedGeneration: 2
      
      1. Note that the applicationID vanished from application CR;
      2. Reinject admin portal certificate to the 3scale Operator to allow the operator to manage the custom resources;
      3. Wait for the operator to reconcile the custom resources and check Application CR again:
      $ oc get application/testapplication -o yaml
      apiVersion: capabilities.3scale.net/v1beta1
      kind: Application
      ...
      status:
        applicationID: 11
        conditions:
        - lastTransitionTime: "2024-05-01T17:18:11Z"
          status: "True"
          type: Ready
        observedGeneration: 2
        providerAccountHost: https://3scale-admin.apps.example.com
        state: live
      1. Note that the applicationID changed from 10 to 11;
      2. Checking the Admin Portal, we can see the duplicated application:

      Workaround:

      If the Custom Resource objects has the "insecure_skip_verify: true" in the metadata -> annotations, the Operator will not remove the applicationID from the Application CR and will work fine.

        1. application.yaml
          0.3 kB
        2. developeraccount.yaml
          0.2 kB
        3. developersecret.yaml
          0.1 kB
        4. developeruser.yaml
          0.3 kB
        5. image-2024-05-01-14-15-16-332.png
          image-2024-05-01-14-15-16-332.png
          195 kB
        6. image-2024-05-01-14-20-06-362.png
          image-2024-05-01-14-20-06-362.png
          206 kB
        7. product.yaml
          0.3 kB

              Unassigned Unassigned
              rhn-support-eazevedo Ernani Azevedo
              Martin Kudlej Martin Kudlej
              Brian Gallagher Brian Gallagher
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

                Created:
                Updated: