Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import {
StorageClassResourceKind,
} from '@console/internal/module/k8s';
import { NodeModel, InfrastructureModel, StorageClassModel } from '@console/internal/models';
import { isDefaultClass } from '@console/internal/components/storage-class';
import { OCSServiceModel } from '../../models';
import {
infraProvisionerMap,
Expand All @@ -43,8 +44,6 @@ import {
import './ocs-install.scss';

const ocsLabel = 'cluster.ocs.openshift.io/openshift-storage';
const nodeLabel = 'cluster.ocs.openshift.io~1openshift-storage';
const defaultSAnotations = { 'storageclass.kubernetes.io/is-default-class': 'true' };

const getConvertedUnits = (value: string) => {
return humanizeBinaryBytes(convertToBaseValue(value)).string || '-';
Expand Down Expand Up @@ -178,7 +177,7 @@ const CustomNodeTable: React.FC<CustomNodeTableProps> = ({ data, loaded, ocsProp
setNodes(formattedNodes);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
Copy link
Contributor

Choose a reason for hiding this comment

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

This also needs to be removed if you are removing JSON.stringify.

}, [JSON.stringify(data), loaded]);
}, [data, loaded]);

const onSelect = (
event: React.MouseEvent<HTMLButtonElement>,
Expand All @@ -204,7 +203,7 @@ const CustomNodeTable: React.FC<CustomNodeTableProps> = ({ data, loaded, ocsProp
const patch = [
{
op: 'add',
path: `/metadata/labels/${nodeLabel}`,
path: '/metadata/labels/cluster.ocs.openshift.io~1openshift-storage',
value: '',
},
];
Expand Down Expand Up @@ -278,7 +277,7 @@ const CustomNodeTable: React.FC<CustomNodeTableProps> = ({ data, loaded, ocsProp
const scList = _.filter(storageClasses, (sc) => sc.provisioner === provisioner);
// take the default storageclass
_.forEach(scList, (sc) => {
if (sc.metadata && _.isEqual(sc.metadata.annotations, defaultSAnotations)) {
if (isDefaultClass(sc)) {
storageClass = sc.metadata.name;
}
});
Expand All @@ -294,6 +293,7 @@ const CustomNodeTable: React.FC<CustomNodeTableProps> = ({ data, loaded, ocsProp
<>
<div className="node-list__max-height">
<Table
aria-label="node list table"
onSelect={onSelect}
cells={columns}
rows={nodes}
Expand Down