Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(console): support terminating status and evicted reason show #977

Merged
merged 1 commit into from
Dec 6, 2020
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 @@ -88,8 +88,6 @@ const fetchPodActions = generateFetcherActionCreator({
isNeedSpecific: false,
isContinue: true
});
// 原因为 Evicted的pod没有必要再进行展示,直接进行过滤
records = records.filter(item => item.status.reason !== 'Evicted');

dispatch(resourcePodActions.changeContinueToken(continueToken));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,16 @@ export class ResourcePodPanel extends React.Component<RootProps, ResourcePodPane
});
}

function getPodStatus(pod) {
let result = pod.status.phase;
if (pod.status.phase === 'Running' && pod.metadata.deletionTimestamp) {
result = <Text theme="warning">Terminating</Text>;
}
if (pod.status.reason) {
result = <>{pod.status.phase}<Text theme="warning">({pod.status.reason})</Text></>
}
return result;
}
return (
<div>
<span
Expand All @@ -412,7 +422,7 @@ export class ResourcePodPanel extends React.Component<RootProps, ResourcePodPane
'text-danger': isStatusOK && !isConditionOK
})}
>
{pod.status.phase}
{getPodStatus.call(this, pod)}
</span>
{(!isStatusOK || !isConditionOK) && pod.status.conditions && (
<Bubble
Expand Down
4 changes: 4 additions & 0 deletions web/console/src/modules/cluster/models/Pod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ interface Metadata {

creationTimestamp?: string;

deletionTimestamp?: string;

name?: string;

namespace?: string;
Expand All @@ -40,6 +42,8 @@ interface Status {

phase?: string;

reason?: string;

qosClass?: string;

/** pod所在node 的ip */
Expand Down