Skip to content

Commit 6304f40

Browse files
authored
Merge pull request #86 from appuio/fix/custom-logo
Don't configure legacy custom logo if we have a 4.19 logo configuration
2 parents 54a6b90 + 47e8487 commit 6304f40

File tree

5 files changed

+8
-56
lines changed

5 files changed

+8
-56
lines changed

component/main.jsonnet

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,10 @@ local favicon =
8282

8383
local legacyLogoFileName =
8484
local legacy_logo = std.get(params, 'custom_logo', {});
85-
if std.length(std.objectFields(legacy_logo)) > 0 then
85+
// OpenShift doesn't allow `customLogoFile` and `logos` to be set at the
86+
// same time, so we never try to configure the legacy `customLogoFile` if
87+
// we're configuring the new `logos`.
88+
if std.length(std.objectFields(legacy_logo)) > 0 && std.length(customLogos) == 0 then
8689
assert std.length(std.objectFields(legacy_logo)) == 1 :
8790
'The parameter custom_logo can only contain a single logo';
8891
local name = std.objectFields(legacy_logo)[0];

docs/modules/ROOT/pages/references/parameters.adoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ default:: `{}`
133133
====
134134
This parameter is deprecated on OpenShift 4.19 and newer.
135135
Use `custom_logos` and `custom_favicon` instead.
136+
137+
When `custom_logos` is set for OpenShift 4.19 and newer, any configuration in this parameter will be ignored.
136138
====
137139

138140
Add a custom logo to the console.
@@ -162,6 +164,8 @@ Configure custom logos for the console.
162164
This parameter only has an effect on OpenShift 4.19 and newer.
163165
For older versions of OpenShift, use parameter `custom_logo`.
164166

167+
NOTE: When setting this parameter on OpenShift 4.19 and newer, the component will ignore the contents of `custom_logo`.
168+
165169
OpenShift 4.19 introduces a new console look with a dark and light theme.
166170
The new custom logo mechanism allows configuring separate logos for each theme.
167171
The component supports keys `dark` and `light` to specify logos for the dark and light theme respectively.

tests/golden/custom-logo/openshift4-console/openshift4-console/01_logo.yaml

Lines changed: 0 additions & 29 deletions
This file was deleted.

tests/golden/custom-logo/openshift4-console/openshift4-console/10_console.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ spec:
1414
- name: LightspeedButton
1515
visibility:
1616
state: Disabled
17-
customLogoFile:
18-
key: logo.png
19-
name: console-logo
2017
customProductName: Company Cloud
2118
logos:
2219
- themes:

tests/golden/custom-logo/openshift4-console/openshift4-console/10_console_favicon_route.yaml

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)