-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Epic: Support for multiple deviceClass on baremetal clusters #1662
Epic: Support for multiple deviceClass on baremetal clusters #1662
Conversation
d8de79c
to
c11f382
Compare
The alert that says, it may increase your expenses has been removed |
@vbnrh Then the screenshots are outdated, right? Can you put an updated one? |
Its the same, just the message on top got removed. |
a28a775
to
0a49e1d
Compare
packages/odf/components/attach-storage-storagesystem/attach-storage.tsx
Outdated
Show resolved
Hide resolved
packages/odf/components/attach-storage-storagesystem/attach-storage.tsx
Outdated
Show resolved
Hide resolved
packages/odf/components/attach-storage-storagesystem/attach-storage.tsx
Outdated
Show resolved
Hide resolved
packages/odf/components/attach-storage-storagesystem/attach-storage.tsx
Outdated
Show resolved
Hide resolved
packages/odf/components/attach-storage-storagesystem/attach-storage.tsx
Outdated
Show resolved
Hide resolved
81b95fe
to
2655757
Compare
const deviceSets: DeviceSet[] = storageCluster?.spec?.storageDeviceSets || []; | ||
const installStorageClass = | ||
deviceSets?.[0]?.dataPVCTemplate?.spec?.storageClassName; | ||
const preSelectionFilter = React.useCallback( | ||
(storageClasses: StorageClassResourceKind[]) => | ||
storageClasses.find((sc) => getName(sc) === installStorageClass), | ||
[installStorageClass] | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check still doesn't make sense. Requirement of this feature is to use a "new" StorageClass, so we shouldn't auto-select "existing" StorageClass.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If anything we should filter out the "existing" StorageClasses from the dropdown.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
const [csv, csvLoaded, csvLoadError] = useFetchCsv({ | ||
specName: LSO_OPERATOR, | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't fetch CSV per row... do it once on the table level and pass it down to each row...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
customKebabItems.push({ | ||
key: 'ATTACH_STORAGE', | ||
value: t('Attach Storage'), | ||
component: undefined, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"undefined" ??
component: undefined, | |
component: undefined, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no component to render, need to navigate to url
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Component is field is somehow required even though it is optional in the properties
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed it, the typing was not done properly
packages/shared/src/kebab/kebab.tsx
Outdated
} else if (actionKey === 'ATTACH_STORAGE') { | ||
const url = `/odf/system/ns/${getNamespace(resource)}/${referenceForModel( | ||
StorageClusterModel | ||
)}/${getName(resource)}/~attachstorage`; | ||
navigate(url); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is shared
directory, we can't have specific checks like actionKey === 'ATTACH_STORAGE'
here...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
This make sense, LGTM.
Better to confirm with Eran whether we want to touch existing "Add Capacity" UI or keep that as it is (so that existing non-advanced user won't get confused). |
IMO for LSO usescase we should not add the new deviceSet using But will open a thread for it |
2655757
to
6baf6e9
Compare
const getStorageClassesNotInDeviceSet = React.useCallback( | ||
( | ||
storageClasses: StorageClassResourceKind[], | ||
deviceSets: DeviceSet[] | ||
): string[] => { | ||
const allStorageClasses = storageClasses.map(getName); | ||
const deviceSetStorageClasses = deviceSets | ||
.map((ds) => ds.dataPVCTemplate.spec.storageClassName) | ||
.filter((name): name is string => Boolean(name)); | ||
|
||
return allStorageClasses.filter( | ||
(scName) => !deviceSetStorageClasses.includes(scName) | ||
); | ||
}, | ||
[existingStorageClasses, storageCluster] | ||
); | ||
|
||
const preSelectionFilter = React.useCallback( | ||
(storageClasses: StorageClassResourceKind[]) => { | ||
const storageClassesNotInDeviceSet = getStorageClassesNotInDeviceSet( | ||
storageClasses, | ||
storageCluster?.spec?.storageDeviceSets || [] | ||
); | ||
return storageClassesNotInDeviceSet[0]; | ||
}, | ||
[[getStorageClassesNotInDeviceSet]] | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
storageClassDropdownFilter
is already filtering all the existing StorageClasses, you directly select 0th of that list.
const getStorageClassesNotInDeviceSet = React.useCallback( | |
( | |
storageClasses: StorageClassResourceKind[], | |
deviceSets: DeviceSet[] | |
): string[] => { | |
const allStorageClasses = storageClasses.map(getName); | |
const deviceSetStorageClasses = deviceSets | |
.map((ds) => ds.dataPVCTemplate.spec.storageClassName) | |
.filter((name): name is string => Boolean(name)); | |
return allStorageClasses.filter( | |
(scName) => !deviceSetStorageClasses.includes(scName) | |
); | |
}, | |
[existingStorageClasses, storageCluster] | |
); | |
const preSelectionFilter = React.useCallback( | |
(storageClasses: StorageClassResourceKind[]) => { | |
const storageClassesNotInDeviceSet = getStorageClassesNotInDeviceSet( | |
storageClasses, | |
storageCluster?.spec?.storageDeviceSets || [] | |
); | |
return storageClassesNotInDeviceSet[0]; | |
}, | |
[[getStorageClassesNotInDeviceSet]] | |
); | |
const preSelectionFilter = React.useCallback( | |
(storageClasses: StorageClassResourceKind[]) => storageClasses?.[0]; | |
}, | |
[] | |
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to filter again...
LGTM other than comment #1662 (comment). |
6baf6e9
to
5b1187b
Compare
Can you please upload an updated screenshot? |
|
packages/odf/components/attach-storage-storagesystem/attach-storage.tsx
Outdated
Show resolved
Hide resolved
packages/odf/components/attach-storage-storagesystem/attach-storage-footer.tsx
Outdated
Show resolved
Hide resolved
packages/odf/components/attach-storage-storagesystem/attach-storage.tsx
Outdated
Show resolved
Hide resolved
packages/odf/components/attach-storage-storagesystem/attach-storage.tsx
Outdated
Show resolved
Hide resolved
packages/odf/components/attach-storage-storagesystem/attach-storage.tsx
Outdated
Show resolved
Hide resolved
packages/odf/components/attach-storage-storagesystem/attach-storage.tsx
Outdated
Show resolved
Hide resolved
packages/odf/components/attach-storage-storagesystem/attach-storage.tsx
Outdated
Show resolved
Hide resolved
packages/odf/components/attach-storage-storagesystem/lso-storageclass-dropdown.tsx
Outdated
Show resolved
Hide resolved
5b1187b
to
6c5b40e
Compare
@bipuladh @SanjalKatiyar @alfonsomthd All comments addressed |
6c5b40e
to
7553da0
Compare
packages/odf/components/attach-storage-storagesystem/lso-storageclass-dropdown.tsx
Outdated
Show resolved
Hide resolved
7553da0
to
9a70dc0
Compare
Signed-off-by: vbadrina <[email protected]>
9a70dc0
to
4eab654
Compare
/test odf-console-e2e-aws |
1 similar comment
/test odf-console-e2e-aws |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: SanjalKatiyar, vbnrh The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/test odf-console-e2e-aws |
1 similar comment
/test odf-console-e2e-aws |
cb13092
into
red-hat-storage:master
https://www.figma.com/proto/s4m2DvEQXcqpl8LEYGRIvw/4795%3A-Support-for-multiple-device-classes-in-the-same-cluster?page-id=8722%3A11106&node-id=8727-18578&node-type=frame&viewport=239%2C165%2C0.05&t=5AAuMMTCAVb0rVTK-1&scaling=scale-down&content-scaling=fixed&starting-point-node-id=8722%3A11107