Skip to content
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

Merged
merged 1 commit into from Aug 19, 2021

Conversation

afreen23
Copy link
Contributor

@afreen23 afreen23 commented Aug 17, 2021

Before:

Screenshot from 2021-08-17 16-29-13

After:
Screenshot from 2021-08-18 20-07-59

Signed-off-by: Afreen Rahman afrahman@redhat.com

@openshift-ci openshift-ci bot added bugzilla/severity-high Referenced Bugzilla bug's severity is high for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. labels Aug 17, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 17, 2021

@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
  • bug is open, matching expected state (open)
  • bug target release (4.9.0) matches configured target release for branch (4.9.0)
  • bug is in the state NEW, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

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:

Bug 1994586: Create local volume set step says "An error has occurred"

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.

@openshift-ci openshift-ci bot added component/ceph Related to ceph-storage-plugin component/lso Related to local-storage-operator-plugin kind/i18n Indicates issue or PR relates to internationalization or has content that needs to be translated approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Aug 17, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 18, 2021

@afreen23: This pull request references Bugzilla bug 1994586, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.9.0) matches configured target release for branch (4.9.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

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:

Bug 1994586: Create local volume set step says "An error has occurred"

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.

@openshift-ci openshift-ci bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 18, 2021
@openshift-ci openshift-ci bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 18, 2021
@afreen23
Copy link
Contributor Author

Forgot to update i18n files. hence tests failing #9818 (comment)

@@ -78,7 +77,6 @@ const StorageClassSelection: React.FC<StorageClassSelectionProps> = ({ dispatch,
noSelection
onChange={onStorageClassSelect}
selectedKey={selected.name}
filter={filterSCWithoutNoProv}
Copy link
Contributor

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 ??

Copy link
Contributor Author

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.

Comment on lines -179 to 193
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]);
Copy link
Contributor

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 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah in PR #9630

Copy link
Contributor

@SanjalKatiyar SanjalKatiyar left a 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,
});
}
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a comment

Copy link
Contributor

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' });
Copy link
Contributor

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,
  },

Copy link
Contributor Author

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

Copy link
Contributor

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 });
Copy link
Contributor

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.

Copy link
Contributor Author

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.

export type CreateStorageSystemAction =
| { type: 'wizard/setStepIdReached'; payload: number }
| {
type: 'wizard/setStorageClass';
payload: WizardState['storageClass'];
}

}

const AllNodesLabel: React.FC<{ count: number }> = ({ count }) => {
const { t } = useTranslation();
Copy link
Contributor

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

Copy link
Contributor Author

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':
Copy link
Contributor

Choose a reason for hiding this comment

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

use constant for these

Copy link
Contributor Author

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} />}
Copy link
Contributor

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>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@GowthamShanmugam
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Aug 19, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 19, 2021

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit 6dd364d into openshift:master Aug 19, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 19, 2021

@afreen23: All pull requests linked via external trackers have merged:

Bugzilla bug 1994586 has been moved to the MODIFIED state.

In response to this:

Bug 1994586: Create local volume set step says "An error has occurred"

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.

@spadgett spadgett added this to the v4.9 milestone Aug 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/severity-high Referenced Bugzilla bug's severity is high for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. component/ceph Related to ceph-storage-plugin component/lso Related to local-storage-operator-plugin kind/i18n Indicates issue or PR relates to internationalization or has content that needs to be translated lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants