Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 2101732

Summary: Need remove old route sample-policy-engine-route after upgrade osus from v4.9 to v5.0
Product: OpenShift Container Platform Reporter: liujia <jiajliu>
Component: OpenShift Update ServiceAssignee: Lalatendu Mohanty <lmohanty>
OpenShift Update Service sub component: operator QA Contact: Yang Yang <yanyang>
Status: CLOSED ERRATA Docs Contact: Kathryn Alexander <kalexand>
Severity: medium    
Priority: medium CC: aos-team-ota, lmohanty, talessio, yanyang
Version: 4.10   
Target Milestone: ---   
Target Release: 4.12.z   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-03-09 11:30:44 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description liujia 2022-06-28 09:23:38 UTC
Description of problem (please be detailed as possible and provide log
snippests):

There are duplicated routes after upgrade osus from v4.9 to v5.0. In v4.9.1, the route name should be $name-policy-engine-route, but in v5.0.0, the route name is changed to $name-route. During the upgrade, new route is created with the new name, but the old one is not removed.

# ./oc get route
NAME                         HOST/PORT                                                                                          PATH   SERVICES               PORT            TERMINATION   WILDCARD
sample-policy-engine-route   sample-policy-engine-route-openshift-update-service.apps.jliu410.qe.gcp.devcluster.openshift.com          sample-policy-engine   policy-engine   edge/None     None
sample-route                 sample-route-openshift-update-service.apps.jliu410.qe.gcp.devcluster.openshift.com                        sample-policy-engine   policy-engine   edge/None     None

The updareservice points to the new route.
# ./oc get updateservice sample -o jsonpath='{.status.policyEngineURI}'
https://sample-route-openshift-update-service.apps.jliu410.qe.gcp.devcluster.openshift.com

Version of all relevant components (if applicable):
cincinnati-container-v5.0.0-4
cincinnati-operator-bundle-container-v5.0.0-3
cincinnati-operator-container-v5.0.0-4


Can this issue reproducible?
always

Can this issue reproduce from the UI?


If this is a regression, please provide more details to justify this:
yes

Steps to Reproduce:
1. Install osus v4.9.1 on ocp4.10, check that operator&operand work well, and policy engine route was created as following(name:sample-policy-engine-route).
# ./oc get route
NAME                         HOST/PORT                                                                                          PATH   SERVICES               PORT            TERMINATION   WILDCARD
sample-policy-engine-route   sample-policy-engine-route-openshift-update-service.apps.jliu410.qe.gcp.devcluster.openshift.com          sample-policy-engine   policy-engine   edge/None     None

2. Upgrade osus v4.9.1 to v5.0.0, check that one more route(sample-route) generated.
# ./oc get route
NAME                         HOST/PORT                                                                                          PATH   SERVICES               PORT            TERMINATION   WILDCARD
sample-policy-engine-route   sample-policy-engine-route-openshift-update-service.apps.jliu410.qe.gcp.devcluster.openshift.com          sample-policy-engine   policy-engine   edge/None     None
sample-route                 sample-route-openshift-update-service.apps.jliu410.qe.gcp.devcluster.openshift.com                        sample-policy-engine   policy-engine   edge/None     None


3.

Actual results:
There are duplicated route, which is not consistent with updateservice instance's policyEngineURI.

Expected results:
The old one should be removed after the new one is created successfully.

Additional info:

Comment 1 Lalatendu Mohanty 2022-06-28 14:56:20 UTC
We should not remove existing routes. Because there is no way to know if that route is used by the customer or not. We check if there is existing route with new name before creating the route in the code [1] but we did not add check for old route name when we moved a new route name because of 63 characters limit for the DNS [2]

[1] https://github.com/openshift/cincinnati-operator/blob/master/controllers/updateservice_controller.go#L528
[2] https://github.com/openshift/cincinnati-operator/pull/135

Comment 2 liujia 2022-06-29 01:06:53 UTC
> Because there is no way to know if that route is used by the customer or not.
+1. good point. 

To remove the old one sounds not reasonable. Maybe we need keep the old one and not create the new one if the old one already existed.

Comment 6 Yang Yang 2023-02-15 09:12:24 UTC
It's hard to verify it as OSUS upgrade path doesn't support 4.9.1 to 5.0.1 directly.
Testing with 
cincinnati-container-v5.0.1-3
cincinnati-operator-bundle-container-v5.0.1-1
cincinnati-operator-container-v5.0.1-3

Tested 4.9.1 -> 5.0.0 -> 5.0.1 and it's reproduced.
Tested 5.0.0 -> 5.0.1 and it does not have such issue

Comment 7 Yang Yang 2023-02-20 08:05:31 UTC
Tested 4.9.1 to 5.0.1 upgrade and passed.

1. Install 4.9.1 OSUS on a 4.11 cluster
# oc get ip
NAME            CSV                              APPROVAL   APPROVED
install-75hns   update-service-operator.v4.9.1   Manual     true
install-mnlhz   update-service-operator.v5.0.1   Manual     false

# oc get csv
NAME                             DISPLAY                    VERSION   REPLACES                         PHASE
update-service-operator.v4.9.1   OpenShift Update Service   4.9.1     update-service-operator.v4.9.0   Succeeded

# oc get po
NAME                                      READY   STATUS    RESTARTS   AGE
sample-79d5ddc59f-64xjn                   2/2     Running   0          19s
updateservice-operator-59f8b85759-b4gzq   1/1     Running   0          61s

# oc get route
NAME                         HOST/PORT                                                                                                PATH   SERVICES               PORT            TERMINATION   WILDCARD
sample-policy-engine-route   sample-policy-engine-route-openshift-update-service.apps.yanyang-0220a.qe.gcp.devcluster.openshift.com          sample-policy-engine   policy-engine   edge/None     None

2. Upgrade to 5.0.1
# oc get ip
NAME            CSV                              APPROVAL   APPROVED
install-75hns   update-service-operator.v4.9.1   Manual     true
install-mnlhz   update-service-operator.v5.0.1   Manual     true

# oc get csv
NAME                             DISPLAY                    VERSION   REPLACES                         PHASE
update-service-operator.v5.0.1   OpenShift Update Service   5.0.1     update-service-operator.v4.9.1   Succeeded

# oc get pod
NAME                                      READY   STATUS    RESTARTS   AGE
sample-d674f4b87-kzbbs                    2/2     Running   0          27s
updateservice-operator-7d48475d76-q4cc4   1/1     Running   0          33s

# oc get route
NAME                         HOST/PORT                                                                                                PATH   SERVICES               PORT            TERMINATION   WILDCARD
sample-policy-engine-route   sample-policy-engine-route-openshift-update-service.apps.yanyang-0220a.qe.gcp.devcluster.openshift.com          sample-policy-engine   policy-engine   edge/None     None

# curl -skH 'Accept:application/json' 'https://sample-policy-engine-route-openshift-update-service.apps.yanyang-0220a.qe.gcp.devcluster.openshift.com/api/upgrades_info/v1/graph?channel=candidate-4.11' | jq
{
  "version": 1,
  "nodes": [
    {
      "version": "4.11.26",
      "payload": "quay.io/openshifttest/ocp-release@sha256:1c3913a65b0a10b4a0650f54e545fe928360a94767acea64c0bd10faa52c945a",
      "metadata": {
        "io.openshift.upgrades.graph.previous.remove_regex": "4[.]10[.].*",
        "io.openshift.upgrades.graph.release.channels": "candidate-4.11,fast-4.11,candidate-4.12,fast-4.12",
        "io.openshift.upgrades.graph.release.manifestref": "sha256:1c3913a65b0a10b4a0650f54e545fe928360a94767acea64c0bd10faa52c945a",
        "url": "https://access.redhat.com/errata/RHSA-2023:0565"
      }
    },
    {
      "version": "4.11.27",
      "payload": "quay.io/openshifttest/ocp-release@sha256:65e71a774a18c1c191f28655ce245abeecd653e8215b75f87eb23ceadacd530d",
      "metadata": {
        "io.openshift.upgrades.graph.release.channels": "candidate-4.11,candidate-4.12",
        "io.openshift.upgrades.graph.release.manifestref": "sha256:65e71a774a18c1c191f28655ce245abeecd653e8215b75f87eb23ceadacd530d",
        "url": "https://access.redhat.com/errata/RHSA-2023:0651"
      }
    }
  ],
  "edges": [
    [
      0,
      1
    ]
  ],
  "conditionalEdges": []
}


After OSUS upgrades from 4.9.1 to 5.0.1, there is only 1 route and it works. Looks good.

Comment 8 Yang Yang 2023-02-20 08:37:27 UTC
Append test images on comment#7
cincinnati-container-v5.0.1-6
cincinnati-operator-bundle-container-v5.0.1-3
cincinnati-operator-container-v5.0.1-6

Comment 9 Yang Yang 2023-02-20 13:17:50 UTC
Moving it to verified based on comment#7.

Comment 11 errata-xmlrpc 2023-03-09 11:30:44 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (RHEA: OSUS Enhancement Update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2023:1161