-
Notifications
You must be signed in to change notification settings - Fork 667
[WIP] OCS Service installtion flow #1982
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
Conversation
|
Hi @gnehapk. 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 Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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/test-infra repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: gnehapk 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 |
spadgett
left a comment
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.
I realize this is WIP and I haven't looked too closely at this, but I wanted to give you some initial comments.
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.
2 spaces indentation, sort declarations
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.
Remove empty line
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.
Add a final newline to the file
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.
Prefer functional components with hooks instead of class components in new code
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.
@gnehapk You can still manage state in your component without using the class syntax.
Take public/components/utils/alerts.tsx as an example, it's a functional component (React.FC) that handles its state via React.useState API.
In general, we should prefer multiple smaller functional components over fewer bigger components, favoring composition over extension.
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.
You should use a label selector in the query instead of filtering on the client
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.
Add types when possible throughout
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.
Hm, don't we want to use k8sList here to fetch multiple resources of the same kind?
k8sList(ConfigMapModel, {
labelSelector: { 'rook.io/node': some.metadata.name },
}).then((configMaps) => {
// ...
});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.
Need to handle JSON.parse errors if it's invalid JSON (here and below)
vojtechszocs
left a comment
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.
I know it's still a WIP, but here are my comments so far.
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.
Since the OCS install flow is part of ceph-storage-plugin, and since there's already a style [1] using the ceph prefix, you might want to use ceph prefix here as well, e.g. .ceph-ocs-info__alert.
[1] src/components/dashboard-page/storage-dashboard/data-resiliency/data-resiliency.scss
cc @cloudbehl
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.
Modules under packages should use lodash.
See packages/.eslintrc.js:
Use lodash instead. webpack is configured to use lodash-es automatically.
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.
I think ESLint will warn about putting each property on a separate line.
Please run yarn lint from the Console monorepo root (frontend directory) and address any code style issues.
#1844 should make it easier to lint a specific package, for example:
yarn eslint packages/ceph-storage-plugin
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.
Hm, don't we want to use k8sList here to fetch multiple resources of the same kind?
k8sList(ConfigMapModel, {
labelSelector: { 'rook.io/node': some.metadata.name },
}).then((configMaps) => {
// ...
});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.
I'd suggest to use a function to compute derived data, instead of keeping locally cached data in variables:
const deviceCount = getStorageDeviceCount(node);This is similar in concept to getNodeRoles function in code above.
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.
I think devicesCount sounds a bit weird with the plural, I'd use deviceCount instead.
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.
@gnehapk You can still manage state in your component without using the class syntax.
Take public/components/utils/alerts.tsx as an example, it's a functional component (React.FC) that handles its state via React.useState API.
In general, we should prefer multiple smaller functional components over fewer bigger components, favoring composition over extension.
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.
Nit: all source files (ts, tsx, scss, etc.) should have a trailing newline.
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.
Nit: I'd suggest adding at least Service to the name of the model, like OCSServiceModel.
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.
I suggest using a webpackChunkName value consistent with other loaders above, i.e. ceph-ocs-service.
|
@gnehapk: PR needs rebase. 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/test-infra repository. |
|
nit: "installtion" -> "installation" in the PR topic |
|
Sent out a new PR as there were many conflicts coming after rebasing it with the master. |
What is Done?
Integration testing with OCS operator is pending. Will do after the availability of OCS operator.
Screenshots -


@alecmerdler @spadgett @vojtechszocs Please review