Skip to content

Commit

Permalink
Merge pull request #3266 from sahil143/show-pod-for-revisions
Browse files Browse the repository at this point in the history
add PodRing to KnativeOverview Component
  • Loading branch information
openshift-merge-robot committed Nov 12, 2019
2 parents d61207a + 1c09364 commit eaf251c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
Expand Up @@ -62,8 +62,8 @@ const PodRing: React.FC<PodRingProps> = ({
handleScaling(clickCount + operation);
};

const isKnative = _.get(obj, 'metadata.ownerReferences[0].kind') === 'Revision';
const isScalingAllowed = !isKnative && editable && enableScaling;
const isKnativeRevision = obj.kind === 'Revision';
const isScalingAllowed = !isKnativeRevision && editable && enableScaling;
const resourceObj = rc || obj;

return (
Expand Down
@@ -1,9 +1,10 @@
import * as React from 'react';
import { ResourceSummary, Kebab, LoadingBox } from '@console/internal/components/utils';
import { ResourceOverviewDetails } from '@console/internal/components/overview/resource-overview-details';
import { OverviewItem } from '@console/shared';
import { OverviewItem, PodRing } from '@console/shared';
import { K8sKind } from '@console/internal/module/k8s';
import { getKsResourceModel } from '../../utils/get-knative-resources';
import { RevisionModel } from '../../models';
import OverviewDetailsKnativeResourcesTab from './OverviewDetailsKnativeResourcesTab';

export type KnativeResourceOverviewPageProps = {
Expand All @@ -13,8 +14,20 @@ export type KnativeResourceOverviewPageProps = {
};

const KnativeOverview: React.FC<KnativeResourceOverviewPageProps> = ({ item }) => {
const { obj, current } = item;
return (
<div className="overview__sidebar-pane-body resource-overview__body">
{obj.kind === RevisionModel.kind && (
<div className="resource-overview__pod-counts">
<PodRing
pods={current ? current.pods : []}
obj={obj}
rc={current && current.obj}
resourceKind={RevisionModel}
path="/spec/replicas"
/>
</div>
)}
<div className="resource-overview__summary">
<ResourceSummary resource={item.obj} />
</div>
Expand Down

0 comments on commit eaf251c

Please sign in to comment.