Skip to content

Commit

Permalink
fix(console): change metadata.labels to spec.selector.matchlabels (tk…
Browse files Browse the repository at this point in the history
  • Loading branch information
jo-hnny committed Nov 30, 2020
1 parent 333673d commit 5211c56
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 23 deletions.
16 changes: 1 addition & 15 deletions web/console/src/modules/cluster/actions/resourcePodActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,23 +69,9 @@ const fetchPodActions = generateFetcherActionCreator({
}
};
} else {
const k8sapp = resourceDetailState?.resourceDetailInfo?.selection?.metadata?.labels?.['k8s-app'];
// hold special case
if (!k8sapp) {
let { records } = await WebAPI.fetchExtraResourceList(podQuery, resourceInfo, isClearData, 'pods');
records = records.filter(item => item.status.reason !== 'Evicted');
dispatch(resourcePodActions.changeContinueToken(''));
return {
records,
recordCount: records.length
};
}

podResourceInfo.namespaces = 'namespaces';
k8sQueryObj = {
labelSelector: {
'k8s-app': k8sapp
},
labelSelector: resourceDetailState?.resourceDetailInfo?.selection?.spec?.selector?.matchlabels,
fieldSelector: {
'metadata.name': podName ? podName : undefined,
'status.phase': phase ? phase : undefined,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,7 @@ export class ResourcePodActionPanel extends React.Component<RootProps, ResourceP
const type = urlParams['type'];
const isInNodeManage = IsInNodeManageDetail(type);
const { subRoot, namespaceList } = this.props,
{ podList, podQuery } = subRoot.resourceDetailState;

// 如果当前pods数目大于指定pageSize,说明当前没有采用分页

if (podList?.data?.recordCount > podQuery?.paging?.pageSize) {
return <noscript />;
}
{ podList } = subRoot.resourceDetailState;

/** podFilter的选择项 */
const podNameValues: any[] = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ export function PodTabel({
stateText={`第${paging.pageIndex}页`}
pageIndexVisible={false}
endJumpVisible={false}
pageSizeVisible={podList?.data?.recordCount <= paging.pageSize}
/>
</Card.Body>
</Card>
Expand Down

0 comments on commit 5211c56

Please sign in to comment.