-
Notifications
You must be signed in to change notification settings - Fork 35
Fix for empty device class #2431
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
base: master
Are you sure you want to change the base?
Fix for empty device class #2431
Conversation
05208c0 to
c0d4b97
Compare
|
/retest |
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.
- In yup validation:
const isDuplicate = existingDeviceClasses.toLowerCase().includes(value?.toLowerCase());
-
As discussed, plz remove
footerContent: t('Example: ssd'),from the popover. -
Plz test these new changes.
| state.lsoStorageClassName | ||
| ) | ||
| .map((ds) => ds.deviceClass); | ||
| .map((ds) => ds.deviceClass || 'ssd'); |
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.
| .map((ds) => ds.deviceClass || 'ssd'); | |
| .map((ds) => ds.deviceClass || DEFAULT_DEVICECLASS); |
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
packages/odf/utils/ocs.ts
Outdated
|
|
||
| const getPVStorageClass = (pv) => pv?.spec?.storageClassName; | ||
|
|
||
| const SSD = DiskType.SSD; |
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.
wrong import...
| const SSD = DiskType.SSD; |
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.
use DEFAULT_DEVICECLASS from shared/constants
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
packages/odf/utils/ocs.ts
Outdated
| }, | ||
| }, | ||
| }, | ||
| deviceClass: SSD, |
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.
| deviceClass: SSD, | |
| deviceClass: DEFAULT_DEVICECLASS, |
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 deviceSets = React.useMemo(() => { | ||
| return storageCluster?.spec?.storageDeviceSets || []; | ||
| }, [storageCluster]); |
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 for useMemo...
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 selectedSCName: string = React.useMemo(() => { | ||
| return getName(storageClass); | ||
| }, [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.
no need for useMemo...
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
| hasMultiDeviceClasses ? deviceClass : null | ||
| ); | ||
| React.useEffect(() => { | ||
| if (deviceClasses.length === 1) { |
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 (deviceClasses.length === 1) { | |
| if (deviceClasses.length === 1 && !deviceClass) { |
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
| if (deviceClasses.length === 1) { | ||
| setDeviceClass(deviceClasses[0]); | ||
| } | ||
| }, [deviceClasses]); |
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.
| }, [deviceClasses]); | |
| }, [deviceClasses, setDeviceClass]); |
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
| ); | ||
| React.useEffect(() => { | ||
| if (deviceClasses.length === 1) { | ||
| setDeviceClass(deviceClasses[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.
| setDeviceClass(deviceClasses[0]); | |
| setDeviceClass(deviceClasses[0] || noDeviceClassKey); |
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
packages/odf/utils/ocs.ts
Outdated
| !!deviceClass && deviceClass !== 'None' | ||
| ? ds.deviceClass === deviceClass | ||
| : !ds.deviceClass; |
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.
| !!deviceClass && deviceClass !== 'None' | |
| ? ds.deviceClass === deviceClass | |
| : !ds.deviceClass; | |
| deviceClass === noDeviceClassKey | |
| ? !ds.deviceClass | |
| : ds.deviceClass === deviceClass; |
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
packages/odf/utils/ocs.ts
Outdated
| ? ds.deviceClass === deviceClass | ||
| : true; | ||
|
|
||
| /* if the deviceClass is an empty string or a "None", we need match it with an index having empty string. */ |
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 the deviceClass is an empty string or a "None", we need match it with an index having empty string. */ | |
| /* if the deviceClass is noDeviceClassKey, we need match it with an index having empty string. */ |
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
|
plz shorten the commit and PR title. |
c0d4b97 to
2efb5b1
Compare
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Harshvardhan-handa123 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
2efb5b1 to
05c01d8
Compare
05c01d8 to
445b8cb
Compare
|
@Harshvardhan-handa123: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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. |
Jira link: https://issues.redhat.com/browse/RHSTOR-8193