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

(feat): Add OCS kebab actions in the LSO disk inventory related to the day2 operations #6124

Merged

Conversation

afreen23
Copy link
Contributor

@afreen23 afreen23 commented Jul 28, 2020

View when OCS_ATTACHED_DEVICES is enabled with OCS based Kebab Actions:
Screenshot from 2020-07-28 12-39-42

Screenshot from 2020-07-28 11-47-48

@openshift-ci-robot openshift-ci-robot added component/ceph Related to ceph-storage-plugin component/lso Related to local-storage-operator-plugin approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jul 28, 2020
@afreen23 afreen23 force-pushed the disk-replacement-kebab-action branch from de46cc3 to f6f2a40 Compare July 28, 2020 07:02
@afreen23
Copy link
Contributor Author

For the time being I have removed troubleshoot action as kebab action. It will be right to bring it back as popover in a followup PR.

@afreen23 afreen23 force-pushed the disk-replacement-kebab-action branch from f6f2a40 to 59020ee Compare July 28, 2020 07:40
@afreen23 afreen23 force-pushed the disk-replacement-kebab-action branch from 59020ee to 2134508 Compare July 28, 2020 09:51
@@ -131,13 +155,21 @@ const DisksListPage: React.FC<{ obj: NodeKind }> = (props) => {
selector: { [LABEL_SELECTOR]: nodeName },
},
]}
customData={{
diskOsdMap: new Map() /* TBD(Afreen) Will be changed to actual state with this https://issues.redhat.com/browse/RHSTOR-1194 */,
Copy link
Contributor

Choose a reason for hiding this comment

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

A question - where are you exactly adding values inside diskOsdMap as you are getting the disk name from this Map?

Copy link
Contributor Author

@afreen23 afreen23 Jul 28, 2020

Choose a reason for hiding this comment

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

I will add the local state to disk list page which will poll data and the pass it down the children.
Will do as part of mentioned issue, its part of another PR.

* TODO:(Afreen) Add validations based on ocs status (part of followup PR)
*/
let template: TemplateKind;
k8sGet(TemplateModel, OSD_REMOVAL_TEMPLATE, CEPH_STORAGE_NAMESPACE)
Copy link
Contributor

Choose a reason for hiding this comment

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

i'd prefer async/await syntax. Makes the flow easier to read.

osdId: string;
} & ModalComponentProps;

type TemplateSecret = K8sResourceCommon & {
Copy link
Contributor

Choose a reason for hiding this comment

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

just use SecretKind type which we already have

Copy link
Contributor Author

@afreen23 afreen23 Jul 28, 2020

Choose a reason for hiding this comment

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

That requires to use data and type , instead I am using stringData .

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The type check is enforcing to add those fields

Copy link
Contributor Author

Choose a reason for hiding this comment

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

export type SecretKind = {
  data: { [key: string]: string };
  stringData?: { [key: string]: string };
  type: string;
} & K8sResourceCommon;

Copy link
Contributor

Choose a reason for hiding this comment

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

so the data and type are actually not required ? I would just make them optional in SecretKind

}),
});

export const OCSKebabOptions: React.FC<{ diskName: string; diskOsdMap: Map<string, string> }> = ({
Copy link
Contributor

Choose a reason for hiding this comment

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

create a separate type definition from { diskName: string; diskOsdMap: Map<string, string> }

@afreen23 afreen23 force-pushed the disk-replacement-kebab-action branch 2 times, most recently from ada1b9e to 0c63c1c Compare July 28, 2020 11:55
@afreen23
Copy link
Contributor Author

/assign @rawagner

/*
* TODO:(Afreen) Add validations based on ocs status (part of followup PR)
*/
instantiatetemplate(osdId)
Copy link
Contributor

Choose a reason for hiding this comment

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

lets not mix async with then syntax

Suggested change
instantiatetemplate(osdId)
try {
instantiatetemplate(osdId);
close();
} catch (err) {
setError(err.message);
} finally {
setProgress(false);
}

osdId: string;
} & ModalComponentProps;

type TemplateSecret = K8sResourceCommon & {
Copy link
Contributor

Choose a reason for hiding this comment

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

so the data and type are actually not required ? I would just make them optional in SecretKind

…e day2 operations

 - Adds the disk replacement action
 - Utilizes flag for attached devices cluster (`OCS_ATTACHED_DEVICES`) to enable the OCS kebab actions
Implements https://issues.redhat.com/browse/RHSTOR-1197

Signed-off-by: Afreen Rahman <afrahman@redhat.com>
@afreen23 afreen23 force-pushed the disk-replacement-kebab-action branch from 0c63c1c to 864b145 Compare July 28, 2020 14:35
@openshift-ci-robot openshift-ci-robot added component/core Related to console core functionality and removed approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jul 28, 2020
@afreen23
Copy link
Contributor Author

@rawagner addressed the reviews.

@rawagner
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 29, 2020
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: afreen23, gnehapk, rawagner

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-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 29, 2020
@openshift-merge-robot openshift-merge-robot merged commit c116d89 into openshift:master Jul 29, 2020
@spadgett spadgett added this to the v4.6 milestone Jul 30, 2020
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. component/ceph Related to ceph-storage-plugin component/core Related to console core functionality component/lso Related to local-storage-operator-plugin 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

6 participants