Skip to content

CONSOLE-5451: Display projected volume sources with navigable links in Volumes table - #16924

Open
swshende-cmd wants to merge 4 commits into
openshift:mainfrom
swshende-cmd:CONSOLE-5451
Open

CONSOLE-5451: Display projected volume sources with navigable links in Volumes table#16924
swshende-cmd wants to merge 4 commits into
openshift:mainfrom
swshende-cmd:CONSOLE-5451

Conversation

@swshende-cmd

@swshende-cmd swshende-cmd commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Analysis / Root cause:

In the OpenShift Console Volumes table (Pod/Deployment/StatefulSet details page), projected volumes displayed a blank or plain-text "Projected" label in the Type column. This prevented users from clicking through to constituent ConfigMaps and Secrets within projected volume mounts. The root cause was that VolumeType component only checked top-level volume keys (volume.secret, volume.configMap, volume.persistentVolumeClaim) for ResourceLink rendering, but never inspected volume.projected.sources for nested resources. Additionally, several volume types (downwardAPI, CSI, ephemeral) were missing from the VolumeSource map, causing a completely empty Type column.

Jira: https://redhat.atlassian.net/browse/CONSOLE-5451

Solution description:

  1. frontend/public/components/utils/volume-type.tsx — Added a new ProjectedVolumeSources component that:

    • Reads volume.projected.sources array
    • Renders clickable ResourceLink hyperlinks for ConfigMap and Secret sources (enabling direct navigation to those resources)
    • Renders text labels for non-navigable sources (ServiceAccountToken, DownwardAPI, ClusterTrustBundle)
    • Falls back gracefully to plain "Projected" text if sources are empty or unreadable
    • Added if (volume.projected) branch in VolumeType to route projected volumes to this component
  2. frontend/public/module/k8s/pods.ts — Added three missing volume types to the VolumeSource map:

    • downwardAPI — renders "DownwardAPI" label
    • csi — renders "CSI" label
    • ephemeral — renders "Ephemeral" label
    • Updated getVolumeLocation switch to return null for these new types

Screenshots / screen recording:

Test setup:

  • OpenShift cluster (4.x) with any pods containing projected volumes (virtually all pods have kube-api-access-* volumes)
  • Navigate to Workloads → Pods → select any pod → scroll to Volumes section

Test cases:

  1. Unit tests: All 951 component tests and 58 k8s module tests pass (yarn test --testPathPatterns='public/components/' and yarn test --testPathPatterns='public/module/k8s/')
  2. ESLint: Zero errors on changed files
  3. Build: Frontend compiles successfully (yarn dev-once)
  4. Cluster validation: Deployed patched console image to live cluster (quay.io/rhn-support-swshende/console:projected-volume-fix), verified:
    • Projected volume kube-api-access-9mncx in openshift-marketplace namespace correctly displays ConfigMap links (kube-root-ca.crt, openshift-service-ca.crt), ServiceAccountToken, and DownwardAPI in the Type column
    • ConfigMap hyperlinks navigate correctly to the respective ConfigMap detail pages
    • Existing Secret, ConfigMap, and PVC volume types continue to render correctly (no regression)
    • Volumes with no recognized type still render gracefully (no UI breakage)

Browser conformance:

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

Additional info:

  • No custom CSS added — reuses existing co-resource-item styles
  • No PatternFly component changes — uses existing ResourceLink component
  • No public API / dynamic plugin SDK impact
  • No i18n key changes required (uses existing translation patterns)
  • Backward compatible — if projected.sources is missing or empty, falls back to "Projected" label

Reviewers and assignees:

/assign @swshende-cmd

Made with Cursor

Summary by CodeRabbit

  • New Features

    • Improved volume details for projected volumes.
    • ConfigMaps and Secrets are now displayed as links.
    • Service account tokens, Downward API sources, and ClusterTrustBundles are shown with clear labels.
    • Added support for displaying CSI, ephemeral, external CSI, and pod-lifecycle-managed volume types.
    • Added clearer labels for additional Kubernetes volume sources.
  • Bug Fixes

    • Unsupported or source-less projected volumes now show a consistent “Projected” label.

…n Volumes table

Projected volumes previously showed a blank or plain-text "Projected" label
in the Type column, preventing users from clicking through to constituent
ConfigMaps and Secrets. This enhances the VolumeType component to iterate
projected sources and render ResourceLinks for ConfigMap/Secret entries,
while displaying text labels for non-navigable sources (ServiceAccountToken,
DownwardAPI, ClusterTrustBundle). Also adds missing volume types (downwardAPI,
CSI, ephemeral) to the VolumeSource map so they display proper labels.

Co-authored-by: Cursor <cursoragent@cursor.com>
@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-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Aug 7, 2026
@openshift-ci-robot

openshift-ci-robot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

@swshende-cmd: This pull request references CONSOLE-5451 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Analysis / Root cause:

In the OpenShift Console Volumes table (Pod/Deployment/StatefulSet details page), projected volumes displayed a blank or plain-text "Projected" label in the Type column. This prevented users from clicking through to constituent ConfigMaps and Secrets within projected volume mounts. The root cause was that VolumeType component only checked top-level volume keys (volume.secret, volume.configMap, volume.persistentVolumeClaim) for ResourceLink rendering, but never inspected volume.projected.sources for nested resources. Additionally, several volume types (downwardAPI, CSI, ephemeral) were missing from the VolumeSource map, causing a completely empty Type column.

Jira: https://redhat.atlassian.net/browse/CONSOLE-5451

Solution description:

  1. frontend/public/components/utils/volume-type.tsx — Added a new ProjectedVolumeSources component that:
  • Reads volume.projected.sources array
  • Renders clickable ResourceLink hyperlinks for ConfigMap and Secret sources (enabling direct navigation to those resources)
  • Renders text labels for non-navigable sources (ServiceAccountToken, DownwardAPI, ClusterTrustBundle)
  • Falls back gracefully to plain "Projected" text if sources are empty or unreadable
  • Added if (volume.projected) branch in VolumeType to route projected volumes to this component
  1. frontend/public/module/k8s/pods.ts — Added three missing volume types to the VolumeSource map:
  • downwardAPI — renders "DownwardAPI" label
  • csi — renders "CSI" label
  • ephemeral — renders "Ephemeral" label
  • Updated getVolumeLocation switch to return null for these new types

Screenshots / screen recording:

Test setup:

  • OpenShift cluster (4.x) with any pods containing projected volumes (virtually all pods have kube-api-access-* volumes)
  • Navigate to Workloads → Pods → select any pod → scroll to Volumes section

Test cases:

  1. Unit tests: All 951 component tests and 58 k8s module tests pass (yarn test --testPathPatterns='public/components/' and yarn test --testPathPatterns='public/module/k8s/')
  2. ESLint: Zero errors on changed files
  3. Build: Frontend compiles successfully (yarn dev-once)
  4. Cluster validation: Deployed patched console image to live cluster (quay.io/rhn-support-swshende/console:projected-volume-fix), verified:
  • Projected volume kube-api-access-9mncx in openshift-marketplace namespace correctly displays ConfigMap links (kube-root-ca.crt, openshift-service-ca.crt), ServiceAccountToken, and DownwardAPI in the Type column
  • ConfigMap hyperlinks navigate correctly to the respective ConfigMap detail pages
  • Existing Secret, ConfigMap, and PVC volume types continue to render correctly (no regression)
  • Volumes with no recognized type still render gracefully (no UI breakage)

Browser conformance:

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

Additional info:

  • No custom CSS added — reuses existing co-resource-item styles
  • No PatternFly component changes — uses existing ResourceLink component
  • No public API / dynamic plugin SDK impact
  • No i18n key changes required (uses existing translation patterns)
  • Backward compatible — if projected.sources is missing or empty, falls back to "Projected" label

Reviewers and assignees:

/assign @swshende-cmd

Made with Cursor

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 commented Aug 7, 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: Pro Plus

Run ID: 198070c4-dec0-40c6-9b6c-0fb26954c4b0

📥 Commits

Reviewing files that changed from the base of the PR and between 3d59faa and 992222a.

📒 Files selected for processing (1)
  • frontend/public/components/utils/volume-type.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • frontend/public/components/utils/volume-type.tsx

Walkthrough

Projected volumes now render ConfigMap and Secret sources as links. Supported non-resource sources render with labels. Unsupported or absent sources use a translated fallback. Additional volume metadata excludes selected types from generic location formatting.

Changes

Projected volume display

Layer / File(s) Summary
Volume source metadata and translations
frontend/public/module/k8s/pods.ts, frontend/public/locales/en/public.json
Added metadata and English translations for Downward API, CSI, ephemeral, ClusterTrustBundle, and ServiceAccountToken sources. Selected volume types now return no generic location.
Projected source rendering
frontend/public/components/utils/volume-type.tsx
Added ConfigMap and Secret links, inline labels for supported sources, fallback text, and delegation from VolumeType.

Estimated code review effort: 2 (Simple) | ~15 minutes

Suggested reviewers: fsgreco, leo6leo

🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the Jira issue and the main change: displaying projected volume sources as navigable links.
Description check ✅ Passed The description covers the root cause, solution, testing, setup, browser status, additional information, and reviewer assignment; screenshots remain absent.
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 three frontend source/locale files; the full diff adds no Ginkgo tests or It/Describe/Context/When titles, so no unstable test name exists to flag.
Test Structure And Quality ✅ Passed The PR changes only TSX, TypeScript, and JSON files; the complete feature diff contains no Go or Ginkgo test code requiring this review.
Microshift Test Compatibility ✅ Passed The PR changes only three frontend files and adds no Ginkgo e2e tests, Go files, or test paths; MicroShift compatibility checks do not apply.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The PR changes only frontend TypeScript and locale files; no new Ginkgo e2e tests or multi-node test assumptions were added.
Topology-Aware Scheduling Compatibility ✅ Passed The change only modifies frontend volume rendering, Kubernetes metadata, and English locale files; it adds no manifests, controllers, operators, replicas, affinities, topology spread, selectors, to...
Ote Binary Stdout Contract ✅ Passed The PR changes only TypeScript/TSX and JSON files; it adds no OTE binary, Go entry point, or suite setup that could write non-JSON stdout.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The complete PR diff changes only frontend volume UI, Kubernetes metadata, and locale files; it adds no Ginkgo e2e tests or IPv4/external-connectivity logic.
No-Weak-Crypto ✅ Passed The complete PR diff adds only volume rendering, metadata, and translations; it introduces no MD5, SHA-1, DES, RC4, Blowfish, ECB, custom crypto, or secret comparisons.
Container-Privileges ✅ Passed The PR changes only volume UI, volume metadata, and locale files; the merge-base diff adds no privileged, host namespace, SYS_ADMIN, or root container settings.
No-Sensitive-Data-In-Logs ✅ Passed The complete PR diff adds no console, logger, print, debugger, trace, Sentry, telemetry, or analytics calls; secret and token values are only rendered as resource labels/links.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@openshift-ci
openshift-ci Bot requested review from Leo6Leo and fsgreco August 7, 2026 14:29
@openshift-ci openshift-ci Bot added the component/core Related to console core functionality label Aug 7, 2026
@openshift-ci

openshift-ci Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: swshende-cmd
Once this PR has been reviewed and has the lgtm label, please assign logonoff 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 the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Aug 7, 2026
@openshift-ci

openshift-ci Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Hi @swshende-cmd. Thanks for your PR.

I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Tip

We noticed you've done this a few times! Consider joining the org to skip this step and gain /lgtm and other bot rights. We recommend asking approvers on your previous PRs to sponsor you.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@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/utils/volume-type.tsx`:
- Around line 19-63: Update the sources.forEach callback in the projected-volume
rendering logic to include each entry’s index and incorporate it into every
generated React key, including ConfigMap, Secret, ServiceAccountToken,
DownwardAPI, and ClusterTrustBundle entries. Add or update a test covering
repeated projected source entries and asserting they render with unique keys.
🪄 Autofix

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: Pro Plus

Run ID: 9eb65d57-4269-4038-ac8d-1b702b43a046

📥 Commits

Reviewing files that changed from the base of the PR and between 82b508f and 5f2d2a9.

📒 Files selected for processing (2)
  • frontend/public/components/utils/volume-type.tsx
  • frontend/public/module/k8s/pods.ts

Comment thread frontend/public/components/utils/volume-type.tsx
@swshende-cmd

swshende-cmd commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

Adding test references before and after fix:

Before:
image

After:
image

@swshende-cmd

Copy link
Copy Markdown
Contributor Author

tested and /verified by @swshende-cmd

Use a deduplicated key generation approach to guarantee unique keys
even when the same ConfigMap or Secret appears multiple times in a
projected volume's sources, while satisfying the no-array-index-key
ESLint rule.

Co-authored-by: Cursor <cursoragent@cursor.com>
@logonoff

logonoff commented Aug 7, 2026

Copy link
Copy Markdown
Member

/ok-to-test

@openshift-ci openshift-ci Bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 7, 2026
Comment on lines +20 to +29
const getUniqueKey = (base: string): string => {
let key = base;
let counter = 1;
while (usedKeys.has(key)) {
key = `${base}-${counter}`;
counter++;
}
usedKeys.add(key);
return key;
};

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

can't use lodash id?

const { t } = useTranslation('public');
const sources = volume.projected?.sources;
if (!Array.isArray(sources) || sources.length === 0) {
return <>{t('Projected')}</>;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You probably don't need the react fragment if you are just returning a string

Comment on lines +100 to +120
downwardAPI: {
id: 'downwardAPI',
label: i18next.t('public~DownwardAPI'),
description: i18next.t(
'public~Exposes pod and container fields to a running container as files.',
),
},
csi: {
id: 'csi',
label: i18next.t('public~CSI'),
description: i18next.t(
'public~Volume provided by an external Container Storage Interface driver.',
),
},
ephemeral: {
id: 'ephemeral',
label: i18next.t('public~Ephemeral'),
description: i18next.t(
'public~Volume that is handled by a cluster storage driver and follows the lifecycle of the pod.',
),
},

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

needs yarn i18n to update strings

Run yarn i18n to register translation keys for newly added volume
type labels (ServiceAccountToken, DownwardAPI, ClusterTrustBundle)
and descriptions (CSI, Ephemeral, DownwardAPI).

Co-authored-by: Cursor <cursoragent@cursor.com>
@swshende-cmd

Copy link
Copy Markdown
Contributor Author

/retest

…ve unnecessary fragments

Use lodash uniqueId for React key generation as suggested by reviewer.
Remove unnecessary React fragments when returning plain strings from
the component.

Co-authored-by: Cursor <cursoragent@cursor.com>
@openshift-ci openshift-ci Bot added the kind/i18n Indicates issue or PR relates to internationalization or has content that needs to be translated label Aug 8, 2026
@openshift-ci

openshift-ci Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

@swshende-cmd: 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.

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 jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. kind/i18n Indicates issue or PR relates to internationalization or has content that needs to be translated ok-to-test Indicates a non-member PR verified by an org member that is safe to test.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants