Skip to content

Add VolumeHealthCard - #2986

Open
SanjalKatiyar wants to merge 1 commit into
red-hat-storage:masterfrom
SanjalKatiyar:pvc_health_card
Open

Add VolumeHealthCard#2986
SanjalKatiyar wants to merge 1 commit into
red-hat-storage:masterfrom
SanjalKatiyar:pvc_health_card

Conversation

@SanjalKatiyar

@SanjalKatiyar SanjalKatiyar commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Description

https://redhat.atlassian.net/browse/RHSTOR-6220

Screenshot 2026-07-28 at 4 53 01 PM Screenshot 2026-07-28 at 5 12 14 PM

Change Type

Please select all applicable options:

  • Feature
  • Bug Fix
  • Improvement
  • Refactor
  • Tests

Component / Area Impacted

Please select all applicable options:

  • ODF
  • FDF
  • Client
  • MCO
  • Fusion Access (SAN Storage)
  • CNSA (Remote Mount)
  • E2E Test

Screenshots / Recordings

Screenshots

TBA

Recordings / Demo Videos

N/A


Testing

Please select the type of tests included:

  • Unit Tests
  • E2E Tests
  • No Tests Required (with justification below)
    Manually testing.

Additional Notes

N/A

@openshift-ci

openshift-ci Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: SanjalKatiyar

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

The pull request process is described 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

@SanjalKatiyar

Copy link
Copy Markdown
Collaborator Author

/hold

@SanjalKatiyar
SanjalKatiyar force-pushed the pvc_health_card branch 6 times, most recently from efb184f to f5e3079 Compare July 28, 2026 05:57
import { ExternalLinkAltIcon } from '@patternfly/react-icons';
import { SortByDirection } from '@patternfly/react-table';

const VOLUME_HEALTH_ANNOTATION_PREFIX = 'csiaddons.openshift.io/volumehealth.';

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.

This can go to constants folder.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

it's not something that will be useful outside the context of this card... it's very specific constant...

Comment thread packages/ocs/utils/common.ts Outdated
scData.filter((sc) => (sc?.provisioner).includes(CEPH_NFS_PROVISIONER));

// All CephNFS based StorageClasses from a particular Ceph cluster (multiple StorageSystem/StorageCluster scenario)
export const filterCephNFSSCByCluster: (

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.

Does external mode support NFS?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

nope...
but these utils are generic, it doesn't care about internal/external or their combinations, all it knows that there should be one cluster per namespace...

Comment on lines +60 to +65
type VolumeHealthAnnotation = {
state: VolumeHealthState;
lastChecked?: string;
since?: string;
node?: 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.

Move this type to shared.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

it's not something that will be useful outside the context of this card... it's very specific type...

UNHEALTHY = 'unhealthy',
}

type VolumeHealthAnnotation = {

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.

The better thing to do would be make PVC kind an interface and extend upon that here instead of having these orphaned types not relating to actual things to which these relate. This pattern is not used in our repo so far but that is the correct way.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I didn't get it... it's just a type for an object that's been read from annotation...
It has nothing to do with PVC kind/interface...

return direction === SortByDirection.asc ? sortValue : -sortValue;
};

const getUnhealthyRows = (

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.

Suggested change
const getUnhealthyRows = (
const getUnhealthyRow = (

Isn't this related to only one row?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

it returns a list VolumeHealthRow[], hence plural :)

Comment on lines +199 to +201
const pvcCount = new Set(
rows.map((row) => `${row.namespace}/${row.pvcName}`)
).size;

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.

I am confused is there a chance of duplicates? Isn't rows.length enough?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

PVCs can we RWX (same volume attached to multiple nodes), each entry is shown as separate row rn (we could change the UX later)...

Example:
Row1: PVC1 Node1
Row2: PVC1 Node2

But, pvcCount should still be 1 in this case.

@SanjalKatiyar

Copy link
Copy Markdown
Collaborator Author

/hold cancel

@SanjalKatiyar

Copy link
Copy Markdown
Collaborator Author

/test odf-console-e2e-aws

1 similar comment
@SanjalKatiyar

Copy link
Copy Markdown
Collaborator Author

/test odf-console-e2e-aws

@SanjalKatiyar

Copy link
Copy Markdown
Collaborator Author

/hold
Might need to remove card from NFS dashboard and add card to Client dashboard.

@SanjalKatiyar

Copy link
Copy Markdown
Collaborator Author

/hold cancel

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants