Bug 1844883

Summary: When using a customized logo in webconsole, favicon is gone
Product: OpenShift Container Platform Reporter: Oren Cohen <ocohen>
Component: Management ConsoleAssignee: Robb Hamilton <rhamilto>
Status: CLOSED NOTABUG QA Contact: Yadan Pei <yapei>
Severity: low Docs Contact:
Priority: unspecified    
Version: 4.4CC: aos-bugs, jhadvig, jokerman, tas
Target Milestone: ---   
Target Release: ---   
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-06-08 14:23:17 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 Oren Cohen 2020-06-07 19:36:48 UTC
Description of problem:
When customizing the web console with a logo, using the "cluster" CustomResource of Console.operator.openshift.io/v1, the favicon[1] of the web page is disappeared. Without console customization, the favicon displays the official Openshift logo.
It happens, for example, in this cluster:
https://console-openshift-console.apps.cnv.engineering.redhat.com/
And I've also reproduced it on a CRC instance of OCP 4.4

[1] favicon is the small logo displayed on the tab title in the browser.

Version-Release number of selected component (if applicable):
OCP 4.4

How reproducible:
100%

Steps to Reproduce:
1. follow the steps here:
https://docs.openshift.com/container-platform/4.4/web_console/customizing-the-web-console.html#adding-a-custom-logo_customizing-web-console
2. watch the favicon disappeared.


Actual results:
Favicon is gone.

Expected results:
Favicon appears.

Additional info:
It would be nice if the favicon displays a small version of the customized logo.

Comment 1 Robb Hamilton 2020-06-08 14:23:17 UTC
Closing as NOTABUG as this is an intentional design decision.  If the console has a custom logo, no favicon is to supposed to display as we did not create a mechanism to specify a custom favicon and do not want to show the OpenShift or OKD favicons if customization is set so as to avoid any branding bleeding through.

Comment 2 Oren Cohen 2020-06-08 14:51:24 UTC
Thanks.
Please consider it as an RFE to allow the user to manually set the favicon (restricting its size to 32x32 pixels).

Comment 3 tas 2021-06-30 12:54:09 UTC
We've worked around this issue by creating a route. There are many icons to choose from within "/static/assets/", so your clusters favicons can be unique.
As its a new resource it is not managed by or overwritten by the operator.

kind: Route
apiVersion: route.openshift.io/v1
metadata:
  name: console-custom-favicon
  namespace: openshift-console
  labels:
    app: console
  annotations:
    haproxy.router.openshift.io/rewrite-target: /static/assets/openshift-favicon.png
spec:
  host: <Same as console or console custom host>
  path: /favicon.ico
  to:
    kind: Service
    name: console
    weight: 100
  port:
    targetPort: https
  tls:
    termination: reencrypt
    insecureEdgeTerminationPolicy: Redirect
  wildcardPolicy: None

Comment 4 Oren Cohen 2021-06-30 13:59:26 UTC
Thank you very much for the tip, @tas , it works perfectly.
Any idea how to add a custom logo file to "/static/assets/" ?

Comment 5 tas 2021-06-30 14:31:33 UTC
That would require mounting additional resources in to the pod and in order to do that without the console operator undoing your changes would be to change its managementState to Unmanaged.
The only time we are able to mount a custom image is via custom-logos. So alternatively, if your custom icon is proportionally sized, you can set the rewrite-target to: "/custom-logo" and the browser should resize the favicon to 32x32.

Comment 6 Oren Cohen 2021-06-30 15:13:15 UTC
Thanks, that works either!
Finally there's a solution to the problem I posted in the BZ a year ago.
Better late than never :)