Skip to content

Commit

Permalink
Update job, replica set, and stateful set tables to show node instead…
Browse files Browse the repository at this point in the history
… of owner
  • Loading branch information
rhamilto committed May 14, 2020
1 parent 2e8e9dd commit 4691eea
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
13 changes: 11 additions & 2 deletions frontend/public/components/job.tsx
Expand Up @@ -5,7 +5,7 @@ import * as classNames from 'classnames';
import { sortable } from '@patternfly/react-table';

import { Status } from '@console/shared';
import { getJobTypeAndCompletions, K8sKind, JobKind } from '../module/k8s';
import { getJobTypeAndCompletions, K8sKind, JobKind, K8sResourceKind } from '../module/k8s';
import { Conditions } from './conditions';
import { DetailsPage, ListPage, Table, TableRow, TableData, RowFunction } from './factory';
import { configureJobParallelismModal } from './modals';
Expand All @@ -15,6 +15,7 @@ import {
Kebab,
KebabAction,
LabelList,
PodsComponent,
ResourceKebab,
ResourceLink,
ResourceSummary,
Expand Down Expand Up @@ -193,14 +194,18 @@ const JobDetails: React.FC<JobsDetailsProps> = ({ obj: job }) => (
</>
);

const JobPods: React.FC<JobPodsProps> = (props) => (
<PodsComponent {...props} customData={{ showNodes: true }} />
);

const { details, pods, editYaml, events } = navFactory;
const JobsDetailsPage: React.FC<JobsDetailsPageProps> = (props) => (
<DetailsPage
{...props}
getResourceStatus={jobStatus}
kind={kind}
menuActions={menuActions}
pages={[details(JobDetails), editYaml(), pods(), events(ResourceEventStream)]}
pages={[details(JobDetails), editYaml(), pods(JobPods), events(ResourceEventStream)]}
/>
);
const JobsList: React.FC = (props) => (
Expand Down Expand Up @@ -228,6 +233,10 @@ type JobsPageProps = {
selector?: any;
};

type JobPodsProps = {
obj: K8sResourceKind;
};

type JobsDetailsPageProps = {
match: any;
};
5 changes: 4 additions & 1 deletion frontend/public/components/replicaset.jsx
Expand Up @@ -21,6 +21,7 @@ import {
ResourceKebab,
OwnerReferences,
Timestamp,
PodsComponent,
} from './utils';
import { ResourceEventStream } from './events';
import { VolumesTable } from './volumes-table';
Expand Down Expand Up @@ -89,6 +90,8 @@ const environmentComponent = (props) => (
/>
);

const ReplicaSetPods = (props) => <PodsComponent {...props} customData={{ showNodes: true }} />;

const { details, editYaml, pods, envEditor, events } = navFactory;
const ReplicaSetsDetailsPage = (props) => (
<DetailsPage
Expand All @@ -97,7 +100,7 @@ const ReplicaSetsDetailsPage = (props) => (
pages={[
details(Details),
editYaml(),
pods(),
pods(ReplicaSetPods),
envEditor(environmentComponent),
events(ResourceEventStream),
]}
Expand Down
11 changes: 10 additions & 1 deletion frontend/public/components/stateful-set.tsx
Expand Up @@ -18,6 +18,7 @@ import {
SectionHeading,
navFactory,
LoadingInline,
PodsComponent,
} from './utils';
import { VolumesTable } from './volumes-table';
import { StatefulSetModel } from '../models';
Expand Down Expand Up @@ -115,10 +116,14 @@ export const StatefulSetsPage: React.FC<StatefulSetsPageProps> = (props) => (
<ListPage {...props} ListComponent={StatefulSetsList} kind={kind} canCreate={true} />
);

const StatefulSetPods: React.FC<StatefulSetPodsProps> = (props) => (
<PodsComponent {...props} customData={{ showNodes: true }} />
);

const pages = [
navFactory.details(StatefulSetDetails),
navFactory.editYaml(),
navFactory.pods(),
navFactory.pods(StatefulSetPods),
navFactory.envEditor(EnvironmentTab),
navFactory.events(ResourceEventStream),
];
Expand Down Expand Up @@ -148,6 +153,10 @@ type StatefulSetsPageProps = {
selector?: any;
};

type StatefulSetPodsProps = {
obj: K8sResourceKind;
};

type StatefulSetsDetailsPageProps = {
match: any;
};

0 comments on commit 4691eea

Please sign in to comment.