Skip to content
This repository has been archived by the owner on Apr 28, 2020. It is now read-only.

Details, Inventory card and Health card for Storage Dashboard #311

Merged
merged 1 commit into from
Apr 8, 2019

Conversation

cloudbehl
Copy link
Contributor

@cloudbehl cloudbehl commented Apr 4, 2019

@coveralls
Copy link

coveralls commented Apr 4, 2019

Pull Request Test Coverage Report for Build 1271

  • 53 of 56 (94.64%) changed or added relevant lines in 9 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.08%) to 87.686%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/components/StorageOverview/OCSHealth/Health.js 5 6 83.33%
src/components/StorageOverview/StorageOverview.js 6 7 85.71%
src/components/StorageOverview/StorageOverviewContext/StorageOverviewContext.js 3 4 75.0%
Totals Coverage Status
Change from base Build 1264: 0.08%
Covered Lines: 3154
Relevant Lines: 3451

💛 - Coveralls

@cloudbehl
Copy link
Contributor Author

Sorry for the XXL PR, Once this is merged will make sure all that for each component we send it separately.

@cloudbehl cloudbehl force-pushed the storage-dashboard-changes branch 2 times, most recently from b8f25e5 to a4082b5 Compare April 5, 2019 06:31
@cloudbehl
Copy link
Contributor Author

@mareklibra @rawagner please review.

@cloudbehl cloudbehl force-pushed the storage-dashboard-changes branch from a4082b5 to d700c65 Compare April 5, 2019 06:43
</DashboardCard>
);

const getClusterName = cephCluster => {
Copy link
Contributor

Choose a reason for hiding this comment

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

no need to have this as separate function - you can directly use getName(cephCluster) and the result will be the same

},
{
component: StorageDetails,
name: 'Loading cluster details',
Copy link
Contributor

Choose a reason for hiding this comment

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

should be Loading storage details


const InventoryBody = ({ nodes, pods, vms, vmis, pvs, pvcs, migrations }) => (
<React.Fragment>
<InventoryRow title="Nodes" {...mapNodesToProps(nodes)} />
Copy link
Contributor

Choose a reason for hiding this comment

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

Looking at the design - you want Nodes, Disks, Pods, PVs and PVCs. You are missing Disks but I guess you will add them later, however VMs here are not needed so you can get rid of vm, vmi and migrations

@@ -0,0 +1,74 @@
import { getVmStatus, VM_STATUS_ALL_ERROR, VM_STATUS_ALL_PROGRESS } from '../../../utils/status/vm';
Copy link
Contributor

Choose a reason for hiding this comment

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

this file is the same as ClusterOverview/Inventory/utils so you could move it to Dashboard/Inventory/utils and reuse it in ClusterOverview/Inventory and StorageOverview/Inventory

Copy link
Contributor

Choose a reason for hiding this comment

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

maybe mapStatuses and resolveStatusResult could be moved. But I am not sure about the other mapXToProps. Shouldn't these be different for each dashboard?

Copy link
Contributor

Choose a reason for hiding this comment

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

as written in #311 (comment) I think that its fine to have overlapping information so IMHO it makes sense to move these utils as other dashboards will use it.

Copy link
Contributor

Choose a reason for hiding this comment

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

if that is the case then sure, it makes sense to move them

Copy link
Contributor Author

@cloudbehl cloudbehl Apr 6, 2019

Choose a reason for hiding this comment

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

@suomiy @rawagner Ack! Done

metadata: {
// should be the same namespaces as the vm
name: 'disk-one_pv',
namespace: 'default',
Copy link
Contributor

Choose a reason for hiding this comment

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

PVs are not namespaced (applies for all other occurrences)

import { NOT_HANDLED } from '../common';

const statusMapper = {
Available: PV_STATUS_AVAILABLE,
Copy link
Contributor

Choose a reason for hiding this comment

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

you could convert all values to form such as Available: { status: PV_STATUS_AVAILABLE } and then in getPvStatus you could just do pv => statusMapper[getStatusPhase(pv)] || {status: PV_STATUS_DEFAULT};. getMappedStatus could be deleted then

Copy link
Contributor

Choose a reason for hiding this comment

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

the statusMapper is only meant to be the mapping of constant -> constant, getMappedStatus can include other functionality 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.

@rawagner @suomiy Is there any action required from my side on this? I am not sure if I understood it well.

Copy link
Contributor

Choose a reason for hiding this comment

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

@suomiy ok, i think there is not action needed @cloudbehl :)

@@ -0,0 +1,49 @@
import React from 'react';
Copy link
Contributor

Choose a reason for hiding this comment

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

We should extract some parts of Health to Dashboard but I think this is fine for now, we can do it as a follow up

export const PV_STATUS_DEFAULT = 'PV_STATUS_DEFAULT';

export const PV_STATUS_ALL_ERROR = [PV_STATUS_FAILED];
export const PV_STATUS_ALL_PROGRESS = [PV_STATUS_AVAILABLE];
Copy link
Contributor

Choose a reason for hiding this comment

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

does it make sense to have Available PV shown as inProgress?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@suomiy The PV that are not bound and are available to be claimed I put them under this category. I was also bit confused about it, if you can provide some feedback on what should be shown in this category.

@@ -0,0 +1,74 @@
import { getVmStatus, VM_STATUS_ALL_ERROR, VM_STATUS_ALL_PROGRESS } from '../../../utils/status/vm';
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe mapStatuses and resolveStatusResult could be moved. But I am not sure about the other mapXToProps. Shouldn't these be different for each dashboard?

<InventoryRow title="Nodes" {...mapNodesToProps(nodes)} />
<InventoryRow title="Pods" {...mapPodsToProps(pods)} />
<InventoryRow title="PVs" {...mapPvsToProps(pvs)} />
<InventoryRow title="PVCs" {...mapPvcsToProps(pvcs)} />
Copy link
Contributor

Choose a reason for hiding this comment

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

what is the point of showing the same information in both dashboards?

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess there will be overlapping information since Cluster Overview is very general and other dashboards will want to focus more on some specifics but still show important parts like PVs and PVCs in case of Storage.

</div>
);

const OCSHealthMap = {
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe it would make sense to make a status component out of this

Copy link
Contributor

Choose a reason for hiding this comment

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

+1 lets do this when we refactor Health Card

@cloudbehl cloudbehl force-pushed the storage-dashboard-changes branch 3 times, most recently from ad167e3 to 0c35f96 Compare April 7, 2019 07:59
- Moved Inventory utils to common place
@cloudbehl cloudbehl force-pushed the storage-dashboard-changes branch from 0c35f96 to d9ad2ee Compare April 7, 2019 08:26
@cloudbehl
Copy link
Contributor Author

@suomiy @rawagner updated the PR.

@rawagner rawagner merged commit 1084c0a into kubevirt:master Apr 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants