Skip to content

Commit

Permalink
fix: Fix daemonset ready pods
Browse files Browse the repository at this point in the history
  • Loading branch information
leoliu committed Jul 7, 2020
1 parent fcfe48d commit 1971a00
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/pages/projects/components/WorkloadStatus/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default function WorkloadStatus({ data, module }) {
type={statusResult}
name={t(statusResult)}
total={get(data, 'status.desiredNumberScheduled', 0)}
ready={get(data, 'status.numberAvailable', 0)}
ready={get(data, 'status.numberReady', 0)}
flicker
/>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/utils/status.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ export const getStatefulSetStatus = ({ spec = {}, status = {} }) => {
}

export const getDaemonSetStatus = ({ status }) => {
if (status.numberAvailable === 0) {
if (status.numberReady === 0) {
return 'Stopped'
}
if (status.numberAvailable === status.desiredNumberScheduled) {
if (status.numberReady === status.desiredNumberScheduled) {
return 'Running'
}
return 'Updating'
Expand Down
2 changes: 1 addition & 1 deletion src/utils/workload.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ export const getWorkloadReplicaCount = (record, module) => {
result.total = get(record, 'podNums', 0)
break
case 'daemonsets':
result.ready = get(record, 'status.numberAvailable', 0)
result.ready = get(record, 'status.numberReady', 0)
result.total = get(record, 'status.desiredNumberScheduled', 0)
break
}
Expand Down

0 comments on commit 1971a00

Please sign in to comment.