Skip to content

OCPBUGS-67295: Fix icon display for duplicate operator names from different catalogs - #16898

Open
ericahinkleRH wants to merge 1 commit into
openshift:mainfrom
ericahinkleRH:OCPBUGS-67295
Open

OCPBUGS-67295: Fix icon display for duplicate operator names from different catalogs#16898
ericahinkleRH wants to merge 1 commit into
openshift:mainfrom
ericahinkleRH:OCPBUGS-67295

Conversation

@ericahinkleRH

@ericahinkleRH ericahinkleRH commented Jul 31, 2026

Copy link
Copy Markdown

Analysis / Root cause:
When multiple catalogs provide operators with the same name (e.g., loki-operator from both redhat-operators and community-operators), the icon URL generation in the iconFor() function does not differentiate between catalogs. This causes incorrect icons to be displayed because the URL only includes the operator name, default channel, and CSV but not the catalog source.

Solution description:
Added catalog: pkg?.status?.catalogSource to the queryParams in the iconFor() function within frontend/packages/operator-lifecycle-manager/src/components/index.tsx. This ensures the icon URL includes the catalog source, allowing the backend to serve the correct icon for operators with duplicate names from different catalogs.

Screenshots / screen recording:

Test setup:

  1. Set up a cluster with multiple catalogs that have operators with duplicate names (e.g., loki-operator in both redhat-operators and community-operators)
  2. Navigate to OperatorHub in the console

Test cases:

  1. Verify that operators with the same name from different catalogs display their correct respective icons
  2. Verify that the icon URL now includes the catalog query parameter
  3. Verify that existing operators with unique names still display icons correctly

Browser conformance:

  • Chrome
  • Firefox
  • Safari (or Epiphany on Linux)

Additional info:
This fix implements the solution proposed by Jian Zhang in OCPBUGS-67295.

Jira: https://issues.redhat.com/browse/OCPBUGS-67295

Reviewers and assignees:
/cc @jcaianirh

Summary by CodeRabbit

  • Bug Fixes
    • Improved icon loading by including the package catalog source in the icon resource URL.

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@openshift-ci
openshift-ci Bot requested a review from jcaianirh July 31, 2026 15:52
@openshift-ci-robot openshift-ci-robot added jira/severity-low Referenced Jira bug's severity is low for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. labels Jul 31, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@ericahinkleRH: This pull request references Jira Issue OCPBUGS-67295, which is invalid:

  • expected the bug to target the "5.0.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

Analysis / Root cause:
When multiple catalogs provide operators with the same name (e.g., loki-operator from both redhat-operators and community-operators), the icon URL generation in the iconFor() function does not differentiate between catalogs. This causes incorrect icons to be displayed because the URL only includes the operator name, default channel, and CSV but not the catalog source.

Solution description:
Added catalog: pkg?.status?.catalogSource to the queryParams in the iconFor() function within frontend/packages/operator-lifecycle-manager/src/components/index.tsx. This ensures the icon URL includes the catalog source, allowing the backend to serve the correct icon for operators with duplicate names from different catalogs.

Screenshots / screen recording:

Test setup:

  1. Set up a cluster with multiple catalogs that have operators with duplicate names (e.g., loki-operator in both redhat-operators and community-operators)
  2. Navigate to OperatorHub in the console

Test cases:

  1. Verify that operators with the same name from different catalogs display their correct respective icons
  2. Verify that the icon URL now includes the catalog query parameter
  3. Verify that existing operators with unique names still display icons correctly

Browser conformance:

  • Chrome
  • Firefox
  • Safari (or Epiphany on Linux)

Additional info:
This fix implements the solution proposed by Jian Zhang in OCPBUGS-67295.

Jira: https://issues.redhat.com/browse/OCPBUGS-67295

Reviewers and assignees:
/cc @jcaianirh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot openshift-ci-robot added the jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. label Jul 31, 2026
@openshift-ci

openshift-ci Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: ericahinkleRH
Once this PR has been reviewed and has the lgtm label, please assign rawagner for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added component/core Related to console core functionality component/olm Related to OLM labels Jul 31, 2026
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: f77b8c16-8860-43bf-ac7d-59e11b7c4717

📥 Commits

Reviewing files that changed from the base of the PR and between e1db335 and db67d14.

📒 Files selected for processing (1)
  • frontend/packages/operator-lifecycle-manager/src/components/index.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • frontend/packages/operator-lifecycle-manager/src/components/index.tsx

Walkthrough

The icon resource URL now includes the package manifest catalog source in its query parameters.

Changes

Icon resource URL

Layer / File(s) Summary
Add catalog source query parameter
frontend/packages/operator-lifecycle-manager/src/components/index.tsx
The icon resource URL includes the package manifest catalog source.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Suggested reviewers: jcaianirh

🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the Jira bug and the fix for incorrect icons caused by duplicate operator names across catalogs.
Description check ✅ Passed The description covers the root cause, solution, setup, test cases, and Jira reference, but it does not provide screenshots or browser testing results.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed The PR changes only one TypeScript source file and adds no Ginkgo tests or test titles, so no unstable test names are introduced.
Test Structure And Quality ✅ Passed The patch changes only one TSX line and adds no Ginkgo tests, cluster operations, waits, setup, cleanup, or assertions to review.
Microshift Test Compatibility ✅ Passed The PR changes only frontend/packages/operator-lifecycle-manager/src/components/index.tsx and adds no Ginkgo e2e tests, so MicroShift test compatibility does not apply.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The pull request changes only a frontend TypeScript file by adding a catalog query parameter; it adds no Ginkgo e2e tests or multi-node assumptions.
Topology-Aware Scheduling Compatibility ✅ Passed The commit changes only iconFor() by adding a catalog query parameter; it adds no manifests, controllers, replicas, affinity, node selectors, tolerations, or other scheduling constraints.
Ote Binary Stdout Contract ✅ Passed The patch changes only a frontend TypeScript query parameter. It adds no OTE binary, suite setup, or process-level stdout write.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The PR changes only a frontend query parameter. It adds no Ginkgo e2e tests, IPv4 assumptions, or external connectivity requirements.
No-Weak-Crypto ✅ Passed The commit changes only iconFor() by adding a catalog query parameter; the diff introduces no weak crypto, custom crypto, or secret comparison.
Container-Privileges ✅ Passed The commit changes only iconFor() in a TypeScript file. The patch adds a catalog query parameter and contains no container/Kubernetes manifest or privilege-related setting.
No-Sensitive-Data-In-Logs ✅ Passed The commit only adds catalogSource to icon URL query parameters. It adds no logging; the existing parse warning is unchanged and logs only the parse error.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Jul 31, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@ericahinkleRH: This pull request references Jira Issue OCPBUGS-67295, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)
Details

In response to this:

Analysis / Root cause:
When multiple catalogs provide operators with the same name (e.g., loki-operator from both redhat-operators and community-operators), the icon URL generation in the iconFor() function does not differentiate between catalogs. This causes incorrect icons to be displayed because the URL only includes the operator name, default channel, and CSV but not the catalog source.

Solution description:
Added catalog: pkg?.status?.catalogSource to the queryParams in the iconFor() function within frontend/packages/operator-lifecycle-manager/src/components/index.tsx. This ensures the icon URL includes the catalog source, allowing the backend to serve the correct icon for operators with duplicate names from different catalogs.

Screenshots / screen recording:

Test setup:

  1. Set up a cluster with multiple catalogs that have operators with duplicate names (e.g., loki-operator in both redhat-operators and community-operators)
  2. Navigate to OperatorHub in the console

Test cases:

  1. Verify that operators with the same name from different catalogs display their correct respective icons
  2. Verify that the icon URL now includes the catalog query parameter
  3. Verify that existing operators with unique names still display icons correctly

Browser conformance:

  • Chrome
  • Firefox
  • Safari (or Epiphany on Linux)

Additional info:
This fix implements the solution proposed by Jian Zhang in OCPBUGS-67295.

Jira: https://issues.redhat.com/browse/OCPBUGS-67295

Reviewers and assignees:
/cc @jcaianirh

Summary by CodeRabbit

  • Improvements
  • Resource quotas for memory, storage, and ephemeral storage now display in readable binary units such as GiB.
  • Quota usage and limit values are formatted consistently across namespace, cluster, and standard quota views.
  • Missing quota values continue to display a clear dash, while other resource types retain their existing formatting.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@ericahinkleRH

Copy link
Copy Markdown
Author

/jira refresh

@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@ericahinkleRH: This pull request references Jira Issue OCPBUGS-67295, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)
Details

In response to this:

/jira refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@frontend/public/components/resource-quota.jsx`:
- Around line 97-100: Update the binary-resource handling in the resource quota
formatter to use convertToBaseValue(value) for string inputs instead of
parseFloat(value), while preserving numeric inputs directly because non-string
values convert to null. Add coverage for Gi, Mi, and ephemeral-storage quantity
values.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: bc19d6d4-6985-4262-8fa6-8f9b15777936

📥 Commits

Reviewing files that changed from the base of the PR and between 074db3a and e1db335.

📒 Files selected for processing (3)
  • frontend/packages/operator-lifecycle-manager/src/components/index.tsx
  • frontend/public/components/__tests__/resource-quota.spec.tsx
  • frontend/public/components/resource-quota.jsx

Comment on lines +97 to +100
if (isBinaryResourceType(resourceType)) {
// Convert string to number for humanizeBinaryBytes
const numericValue = typeof value === 'string' ? parseFloat(value) : value;
return humanizeBinaryBytes(numericValue).string;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

ast-grep outline frontend/public/components/utils/units.js --items all --match 'convertToBaseValue|humanizeBinaryBytes'
rg -n -C 3 'convertToBaseValue|humanizeBinaryBytes|parseFloat' \
  frontend/public/components/utils/units.js \
  frontend/public/components/resource-quota.jsx \
  frontend/public/components/__tests__/resource-quota.spec.tsx

Repository: openshift/console

Length of output: 5193


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- units.js conversion and humanizer implementation ---'
sed -n '220,390p' frontend/public/components/utils/units.js
printf '%s\n' '--- resource-quota.jsx context ---'
sed -n '1,180p' frontend/public/components/resource-quota.jsx
printf '%s\n' '--- resource-quota tests ---'
sed -n '1,260p' frontend/public/components/__tests__/resource-quota.spec.tsx
printf '%s\n' '--- quantity-related tests/usages ---'
rg -n -C 3 'convertToBaseValue|humanizeBinaryBytes|formatResourceValue|ephemeral-storage|[0-9]+(Ki|Mi|Gi|Ti)' \
  frontend/public/components --glob '*.{js,jsx,ts,tsx}' | head -n 500

Repository: openshift/console

Length of output: 50373


🏁 Script executed:

#!/bin/bash
set -euo pipefail

python3 - <<'PY'
from pathlib import Path
p = Path("frontend/public/components/utils/units.js")
s = p.read_text()
start = s.index("const splitValueAndUnit")
end = s.index("export const convertToBaseValue")
print(s[start:end])
end2 = s.find("\n};", end)
print(s[end:end2 + 3])
PY

node - <<'JS'
const values = ['1Gi', '1Mi', '1G', '100m', '123', '1.5Gi', '1e3'];
for (const value of values) {
  console.log(JSON.stringify(value), parseFloat(value));
}
JS

Repository: openshift/console

Length of output: 260


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- conversion implementation ---'
sed -n '180,220p' frontend/public/components/utils/units.js
sed -n '355,410p' frontend/public/components/utils/units.js

printf '%s\n' '--- focused conversion tests ---'
sed -n '225,285p' frontend/public/components/__tests__/units.spec.js
rg -n -C 2 "ResourceUsageRow|requests.memory|requests.storage|ephemeral-storage|Gi|Mi" \
  frontend/public/components/__tests__/resource-quota.spec.tsx

printf '%s\n' '--- standalone quantity behavior ---'
node - <<'JS'
const binary = { Ki: 2 ** 10, Mi: 2 ** 20, Gi: 2 ** 30, Ti: 2 ** 40, Pi: 2 ** 50, Ei: 2 ** 60 };
for (const input of ['1Gi', '1Mi', '5Gi', '10Gi', '2147483648']) {
  const parsed = Number.parseFloat(input);
  const match = input.match(/^([0-9]+(?:\.[0-9]+)?)([A-Za-z]+)?$/);
  const converted = match
    ? Number(match[1]) * (match[2] ? binary[match[2]] : 1)
    : null;
  console.log(`${input}: parseFloat=${parsed}, quantityBaseValue=${converted}`);
}
console.log(`numeric convertToBaseValue contract: non-string -> null`);
JS

Repository: openshift/console

Length of output: 8584


Convert Kubernetes quantity strings before humanizing.

When value is a string, use convertToBaseValue(value) instead of parseFloat(value). Preserve numeric values because convertToBaseValue returns null for non-string inputs. Add coverage for Gi, Mi, and ephemeral-storage values.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@frontend/public/components/resource-quota.jsx` around lines 97 - 100, Update
the binary-resource handling in the resource quota formatter to use
convertToBaseValue(value) for string inputs instead of parseFloat(value), while
preserving numeric inputs directly because non-string values convert to null.
Add coverage for Gi, Mi, and ephemeral-storage quantity values.

…ferent catalogs

When multiple catalogs provide operators with the same name (e.g., loki-operator from both
redhat-operators and community-operators), the icon URL must include the catalog source to
ensure the correct icon is displayed. Added catalog parameter to icon URL queryParams.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@ericahinkleRH: This pull request references Jira Issue OCPBUGS-67295, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)
Details

In response to this:

Analysis / Root cause:
When multiple catalogs provide operators with the same name (e.g., loki-operator from both redhat-operators and community-operators), the icon URL generation in the iconFor() function does not differentiate between catalogs. This causes incorrect icons to be displayed because the URL only includes the operator name, default channel, and CSV but not the catalog source.

Solution description:
Added catalog: pkg?.status?.catalogSource to the queryParams in the iconFor() function within frontend/packages/operator-lifecycle-manager/src/components/index.tsx. This ensures the icon URL includes the catalog source, allowing the backend to serve the correct icon for operators with duplicate names from different catalogs.

Screenshots / screen recording:

Test setup:

  1. Set up a cluster with multiple catalogs that have operators with duplicate names (e.g., loki-operator in both redhat-operators and community-operators)
  2. Navigate to OperatorHub in the console

Test cases:

  1. Verify that operators with the same name from different catalogs display their correct respective icons
  2. Verify that the icon URL now includes the catalog query parameter
  3. Verify that existing operators with unique names still display icons correctly

Browser conformance:

  • Chrome
  • Firefox
  • Safari (or Epiphany on Linux)

Additional info:
This fix implements the solution proposed by Jian Zhang in OCPBUGS-67295.

Jira: https://issues.redhat.com/browse/OCPBUGS-67295

Reviewers and assignees:
/cc @jcaianirh

Summary by CodeRabbit

  • Bug Fixes
  • Improved icon loading by including the package catalog source in the icon resource URL.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci

openshift-ci Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

@ericahinkleRH: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@ericahinkleRH

Copy link
Copy Markdown
Author

@jcaianirh could you please trigger the remaining tests here? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/core Related to console core functionality component/olm Related to OLM jira/severity-low Referenced Jira bug's severity is low for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants