Skip to content

Commit

Permalink
Merge pull request #7985 from jerolimov/bz-1921603-4.6
Browse files Browse the repository at this point in the history
[release-4.6] Bug 1921603: Fix crash when loaded is true but the data set doesn't include the pods
  • Loading branch information
openshift-merge-robot committed Feb 11, 2021
2 parents a0f54a7 + 7e5ab13 commit 91c7257
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
9 changes: 6 additions & 3 deletions frontend/public/components/daemon-set.tsx
Expand Up @@ -146,16 +146,19 @@ const DaemonSetDetails: React.FC<DaemonSetDetailsProps> = ({ obj: daemonset }) =
namespace={daemonset.metadata.namespace}
kind={daemonset.kind}
render={(d) => {
return d.loaded ? (
if (!d.loaded) {
return <LoadingInline />;
} else if (!d.data[daemonset.metadata.uid].pods) {
return null;
}
return (
<PodRing
key={daemonset.metadata.uid}
pods={d.data[daemonset.metadata.uid].pods}
obj={daemonset}
resourceKind={DaemonSetModel}
enableScaling={false}
/>
) : (
<LoadingInline />
);
}}
/>
Expand Down
9 changes: 6 additions & 3 deletions frontend/public/components/deployment-config.tsx
Expand Up @@ -172,16 +172,19 @@ export const DeploymentConfigsDetails: React.FC<{ obj: K8sResourceKind }> = ({ o
namespace={dc.metadata.namespace}
kind={dc.kind}
render={(d) => {
return d.loaded ? (
if (!d.loaded) {
return <LoadingInline />;
} else if (!d.data[dc.metadata.uid]) {
return null;
}
return (
<PodRingSet
key={dc.metadata.uid}
podData={d.data[dc.metadata.uid]}
obj={dc}
resourceKind={DeploymentConfigModel}
path="/spec/replicas"
/>
) : (
<LoadingInline />
);
}}
/>
Expand Down
9 changes: 6 additions & 3 deletions frontend/public/components/stateful-set.tsx
Expand Up @@ -61,16 +61,19 @@ const StatefulSetDetails: React.FC<StatefulSetDetailsProps> = ({ obj: ss }) => (
namespace={ss.metadata.namespace}
kind={ss.kind}
render={(d) => {
return d.loaded ? (
if (!d.loaded) {
return <LoadingInline />;
} else if (!d.data[ss.metadata.uid]) {
return null;
}
return (
<PodRingSet
key={ss.metadata.uid}
podData={d.data[ss.metadata.uid]}
obj={ss}
resourceKind={StatefulSetModel}
path="/spec/replicas"
/>
) : (
<LoadingInline />
);
}}
/>
Expand Down

0 comments on commit 91c7257

Please sign in to comment.