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
Bug 1994586: Create local volume set step says "An error has occurred" #9818
Conversation
@afreen23: This pull request references Bugzilla bug 1994586, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker. 3 validation(s) were run on this bug
No GitHub users were found matching the public email listed for the QA contact in Bugzilla (ratamir@redhat.com), skipping review request. In response to this:
Instructions 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. |
@afreen23: This pull request references Bugzilla bug 1994586, which is valid. 3 validation(s) were run on this bug
No GitHub users were found matching the public email listed for the QA contact in Bugzilla (ratamir@redhat.com), skipping review request. In response to this:
Instructions 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. |
Forgot to update i18n files. hence tests failing #9818 (comment) |
...orage-system/create-storage-system-steps/capacity-and-nodes-step/capacity-and-nodes-step.tsx
Outdated
Show resolved
Hide resolved
@@ -78,7 +77,6 @@ const StorageClassSelection: React.FC<StorageClassSelectionProps> = ({ dispatch, | |||
noSelection | |||
onChange={onStorageClassSelect} | |||
selectedKey={selected.name} | |||
filter={filterSCWithoutNoProv} |
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.
Can we now make internal mode cluster with no-prov
storage-class as well ??
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.
yeah , we have removed notion of internal and external mode.
...em/create-storage-system-steps/create-local-volume-set-step/create-local-volume-set-step.tsx
Outdated
Show resolved
Hide resolved
...em/create-storage-system-steps/create-local-volume-set-step/create-local-volume-set-step.tsx
Outdated
Show resolved
Hide resolved
...torage-system/create-storage-system-steps/create-local-volume-set-step/selected-capacity.tsx
Outdated
Show resolved
Hide resolved
await Promise.all(labelNodes(state.capacityAndNodes.nodes)); | ||
if (nodes) await Promise.all(labelNodes(nodes)); | ||
const requests = payloads.map(({ model, payload }) => k8sCreate(model as K8sKind, payload)); | ||
await Promise.all([labelOCSNamespace(), ...requests]); |
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.
Will this: #9409 (comment) be handled in some other PR ?
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.
yeah in PR #9630
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.
Looks good to me.
/assign @GowthamShanmugam
For one more round of review.
type: 'wizard/setStepIdReached', | ||
payload: 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.
I think it's the same without this if condition. Maybe adding this condition will create some confusion while reading the 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.
Nope , think of the case when user will move back and forth.
The value for stepIdReached
would be more than 1 and then we want this to happen.
It s necessary when user went through a flow but thinks he wants to come back and go with another flow.
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 can add this as a comment , to make it clear.
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.
Added 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.
ack
@@ -80,10 +42,15 @@ const SelectCapacityAndNodes: React.FC<SelectCapacityAndNodesProps> = ({ | |||
}) => { | |||
const { t } = useTranslation(); | |||
|
|||
React.useEffect(() => { | |||
if (!capacity) dispatch({ type: 'capacityAndNodes/capacity', payload: '2Ti' }); |
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.
Can do this initialization in initiState itself?
capacityAndNodes: {
enableArbiter: false,
capacity: '2Ti'',
pvCount: 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.
It was previously but there are two flows - local devices and internal.
In case of local devices we dont want 2Ti. hence initializing states separately in those components
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.
ack
const onRowSelected = React.useCallback( | ||
(selectedNodes: NodeKind[]) => { | ||
const nodesData = createWizardNodeState(selectedNodes); | ||
dispatch({ type: 'capacityAndNodes/nodes', payload: nodesData }); | ||
dispatch({ type: 'wizard/nodes', payload: nodesData }); |
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.
It will be easy to use if we replace these strings ''wizard/nodes' using constant, it used in multiple places, and a small change in this string will need a lot of effort to modify in all places.
But it's ok, for now, need to do that in the future.
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.
Not really. You will get intellisense for these.
These all are defined as types. Typescript will throw error if you define any string wrong.
console/frontend/packages/ceph-storage-plugin/src/components/create-storage-system/reducer.ts
Lines 233 to 238 in d37cf6e
export type CreateStorageSystemAction = | |
| { type: 'wizard/setStepIdReached'; payload: number } | |
| { | |
type: 'wizard/setStorageClass'; | |
payload: WizardState['storageClass']; | |
} |
} | ||
|
||
const AllNodesLabel: React.FC<{ count: number }> = ({ count }) => { | ||
const { t } = useTranslation(); |
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.
pass tFunction also as a parameter
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 a hook available so we can use that.
No need to pass t
@@ -154,6 +150,8 @@ export type LocalVolumeSet = { | |||
export const reducer: WizardReducer = (prevState, action) => { | |||
const newState = _.cloneDeep(prevState); | |||
switch (action.type) { | |||
case 'wizard/setInitialState': |
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 constant for these
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.
We have types for these. These are consts only.
#9818 (comment)
<SelectedNodesTable data={nodes} /> | ||
{!!nodes.length && <NodesDetails nodes={nodes} />} | ||
{!!nodes.length && <SelectNodesTableFooter nodes={nodes} />} |
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 can move this inside <SelectedNodesTable> just like <SelectNodesTable>
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
- Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1994586 Signed-off-by: Afreen Rahman <afrahman@redhat.com>
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: afreen23, GowthamShanmugam 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 |
@afreen23: All pull requests linked via external trackers have merged: Bugzilla bug 1994586 has been moved to the MODIFIED state. In response to this:
Instructions 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. |
Before:
After:
Signed-off-by: Afreen Rahman afrahman@redhat.com