Bug 1826689

Summary: console-custom route is not deleted after route specification is removed from operator config
Product: OpenShift Container Platform Reporter: Yadan Pei <yapei>
Component: Management ConsoleAssignee: bpeterse
Status: CLOSED DUPLICATE QA Contact: Yadan Pei <yapei>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.5CC: aos-bugs, jhadvig, jokerman, yapei
Target Milestone: ---   
Target Release: 4.5.0   
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: 2020-04-23 07:09:36 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 Yadan Pei 2020-04-22 10:42:02 UTC
Description of problem:
after we removed route specification from operator config, the console-custom route still exists in openshift-console, it is not removed

Version-Release number of selected component (if applicable):
4.5.0-0.nightly-2020-04-21-103613

How reproducible:
Always

Steps to Reproduce:
1. add custom route URL and secret reference in operator config
$ oc create secret tls custom-tls-secret --cert ./tls.crt --key ./tls.key -n openshift-config
$ oc get console.operator cluster -o json | jq '.spec'
{
  "managementState": "Managed",
  "route": {
    "hostname": "",
    "secret": {
      "name": "custom-tls-secret"
    }
  }
}
2. A new console-custom route will be created after we add correct settings
3. remove route specification from operator config
# oc get console.operator cluster -o json | jq '.spec'
{
  "managementState": "Managed"
}
# oc get route -n openshift-console
NAME             HOST/PORT                                                                     PATH   SERVICES    PORT    TERMINATION          WILDCARD
console          console-openshift-console.apps.qe-yapeius0421.qe.devcluster.openshift.com            console     https   reencrypt/Redirect   None
console-custom   qe-yapei-custom-console.com                                                          console     https   reencrypt/Redirect   None
downloads        downloads-openshift-console.apps.qe-yapeius0421.qe.devcluster.openshift.com          downloads   http    edge/Redirect        None


Actual results:
3. the console-custom route still exists in openshift-console project

Expected results:
3. since we have removed route specification configuration from operator config, so the custom-console route should be delete too. From PR https://github.com/openshift/console-operator/pull/402/files, it looks like the route can only be deleted when spec.managementState is set to Removed

Additional info:

Comment 1 Yadan Pei 2020-04-22 10:51:30 UTC
If we defined new route, the console-custom will has use host but if we didn't set new customized route, the route will be always there, it looks a little wired

Comment 2 Jakub Hadvig 2020-04-23 07:09:36 UTC

*** This bug has been marked as a duplicate of bug 1826628 ***