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

Add Snapshots to VM Details #5954

Merged

Conversation

glekner
Copy link
Contributor

@glekner glekner commented Jul 12, 2020

Minimal Implementation of VM Snapshots.
There was no way to filter snapshots with the current DefaultPage because fieldSelector doesn't support spec.source.name, so I added a filter function prop.

Screen Shot 2020-07-12 at 21 58 22

@openshift-ci-robot openshift-ci-robot added the component/core Related to console core functionality label Jul 12, 2020
@openshift-ci-robot openshift-ci-robot added the component/kubevirt Related to kubevirt-plugin label Jul 12, 2020
@glekner glekner marked this pull request as draft July 13, 2020 08:56
@openshift-ci-robot openshift-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 13, 2020
@glekner glekner force-pushed the vm-details-snapshots branch 4 times, most recently from a053118 to 50beb4d Compare July 13, 2020 13:55
@glekner glekner marked this pull request as ready for review July 13, 2020 14:02
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 13, 2020
@glekner glekner force-pushed the vm-details-snapshots branch 5 times, most recently from 2a6bfe8 to c87d1f2 Compare July 14, 2020 12:14
@glekner
Copy link
Contributor Author

glekner commented Jul 14, 2020

@suomiy @yaacov can you review?


const submit = async (e) => {
e.preventDefault();
const newSnapshot: VMSnapshot = {
Copy link
Member

Choose a reason for hiding this comment

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

could you please create a wrapper for these?

return (
<TableRow id={name} index={index} trKey={name} style={style}>
<TableData className={dimensify()}>
<ValidationCell validation={validation.name}>
Copy link
Member

Choose a reason for hiding this comment

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

I suppose we probably don't need validations yet, but it probably doesn't hurt to have it setup for potential future.

name: getName(snapshot),
namespace: getNamespace(snapshot),
date: getCreationTimestamp(snapshot),
status: getCondition(getStatusConditions(snapshot), READY)?.status,
Copy link
Member

Choose a reason for hiding this comment

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

the status is more complex.

  • There are two (Ready and Progressing) conditions which should be read and final status created.
  • we should also account for the Error field and potentially ReadyToUse one as well

Copy link
Member

Choose a reason for hiding this comment

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

it could be worth creating an enum for the final status used by UI

const snapshotsRowData = data.map((snapshot) => ({
name: getName(snapshot),
namespace: getNamespace(snapshot),
date: getCreationTimestamp(snapshot),
Copy link
Member

Choose a reason for hiding this comment

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

can we call it creationTimestamp as well since date is too generic?

loaded,
loadError,
}) => {
const snapshotsRowData = data.map((snapshot) => ({
Copy link
Member

Choose a reason for hiding this comment

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

there should be metadata.name and metadata.uid field for the table to work properly

@glekner glekner force-pushed the vm-details-snapshots branch 2 times, most recently from afc0e69 to a782f3b Compare July 15, 2020 10:48
@glekner
Copy link
Contributor Author

glekner commented Jul 15, 2020

@suomiy fixed suggestions, added wrapper

@glekner glekner force-pushed the vm-details-snapshots branch 2 times, most recently from 70564b7 to 0253a12 Compare July 15, 2020 11:34
transforms: [sortable],
},
{
title: 'Date',
Copy link
Member

Choose a reason for hiding this comment

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

convention in console is Created

</ValidationCell>
</TableData>
<TableData className={dimensify()}>
<ValidationCell validation={validation.date}>
Copy link
Member

Choose a reason for hiding this comment

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

creationTimestamp ? maybe it would be easier to remove the validations after all

</TableData>
<TableData className={dimensify()}>
<ValidationCell validation={validation.status}>
<Status status={snapshot?.status?.readyToUse ? 'Ready' : 'Not Ready'} />
Copy link
Member

Choose a reason for hiding this comment

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

statuses still need fixing + good filtering


export type SnapshotSimpleDataValidation = {
name?: ValidationObject;
date?: ValidationObject;
Copy link
Member

Choose a reason for hiding this comment

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

+here

@glekner glekner force-pushed the vm-details-snapshots branch 3 times, most recently from 6e2f9a8 to 46ec70d Compare July 16, 2020 09:39
@glekner
Copy link
Contributor Author

glekner commented Jul 16, 2020

Added initial snapshot name - vmName-YYYY-MM-DD

@glekner glekner force-pushed the vm-details-snapshots branch 5 times, most recently from 82dac98 to a4d3684 Compare July 21, 2020 11:21
@openshift-ci-robot openshift-ci-robot added component/backend Related to backend component/ceph Related to ceph-storage-plugin component/dashboard Related to dashboard component/dev-console Related to dev-console component/knative Related to knative-plugin component/lso Related to local-storage-operator-plugin component/metal3 Related to metal3-plugin component/monitoring Related to monitoring component/olm Related to OLM component/sdk Related to console-plugin-sdk component/shared Related to console-shared labels Jul 22, 2020
@yaacov
Copy link
Member

yaacov commented Jul 22, 2020

/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: glekner, yaacov

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 22, 2020
@yaacov
Copy link
Member

yaacov commented Jul 22, 2020

/retest

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

2 similar comments
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit 661d82b into openshift:master Jul 22, 2020
@spadgett spadgett added this to the v4.6 milestone Jul 28, 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/backend Related to backend component/ceph Related to ceph-storage-plugin component/core Related to console core functionality component/dashboard Related to dashboard component/dev-console Related to dev-console component/knative Related to knative-plugin component/kubevirt Related to kubevirt-plugin component/lso Related to local-storage-operator-plugin component/metal3 Related to metal3-plugin component/monitoring Related to monitoring component/olm Related to OLM component/sdk Related to console-plugin-sdk component/shared Related to console-shared 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

7 participants