Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { K8sResourceKind } from '@console/internal/module/k8s/index';
import { getName } from '@console/shared/src/selectors/common';
import { referenceForModel } from '@console/internal/module/k8s/k8s';
import { CephClusterModel } from '../../../models';
import { CEPH_STORAGE_NAMESPACE, CEPH_CLUSTER_NAME } from '../../../constants/index';
import { CEPH_STORAGE_NAMESPACE } from '../../../constants/index';

const getInfrastructurePlatform = (infrastructure: K8sResourceKind): string =>
_.get(infrastructure, 'status.platform');
Expand All @@ -36,8 +36,7 @@ const cephClusterResource: FirehoseResource = {
kind: referenceForModel(CephClusterModel),
namespaced: true,
namespace: CEPH_STORAGE_NAMESPACE,
name: CEPH_CLUSTER_NAME,
isList: false,
isList: true,
prop: 'ceph',
};

Expand All @@ -61,7 +60,7 @@ const DetailsCard: React.FC<DashboardItemProps> = ({

const cephCluster = _.get(resources, 'ceph');
const cephClusterLoaded = _.get(cephCluster, 'loaded', false);
const cephClusterData = _.get(cephCluster, 'data') as K8sResourceKind;
const cephClusterData = _.get(cephCluster, 'data') as K8sResourceKind[];

return (
<DashboardCard>
Expand All @@ -73,7 +72,7 @@ const DetailsCard: React.FC<DashboardItemProps> = ({
<DetailItem
key="name"
title="Name"
value={getName(cephClusterData)}
value={getName(_.get(cephClusterData, 0))}
isLoading={!cephClusterLoaded}
/>
<DetailItem
Expand All @@ -85,7 +84,7 @@ const DetailsCard: React.FC<DashboardItemProps> = ({
<DetailItem
key="version"
title="Version"
value={getCephVersion(cephClusterData)}
value={getCephVersion(_.get(cephClusterData, 0))}
isLoading={!cephClusterLoaded}
/>
</DetailsBody>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ export const CEPH_DEGRADED = 'Ceph health is degraded';
export const CEPH_ERROR = 'Ceph health is in error state';
export const CEPH_UNKNOWN = 'Ceph is not available';
export const CEPH_STORAGE_NAMESPACE = 'openshift-storage';
export const CEPH_CLUSTER_NAME = 'rook-ceph';
export const ONE_HR = '1 Hour';
export const SIX_HR = '6 Hours';
export const TWENTY_FOUR_HR = '24 Hours';
Expand Down