Skip to content

Commit

Permalink
fix: need to distinguish s2i status and pod status
Browse files Browse the repository at this point in the history
  • Loading branch information
ymh1028 committed Feb 10, 2020
1 parent 771b358 commit 64c3a93
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
12 changes: 4 additions & 8 deletions src/pages/projects/components/WorkloadStatus/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,12 @@ import { getWorkloadStatus } from 'utils/status'
import styles from './index.scss'

export default function WorkloadStatus({ data, module }) {
const { status: statusResult } = getWorkloadStatus(data, module)

if (data.hasS2i) {
const { status: statusResult } = getWorkloadStatus(data, module) || ''
if (statusResult.startsWith('S2I')) {
const S2iStatus = statusResult.slice(4)
return (
<div className={styles.status}>
<Status
type={statusResult}
name={t(S2I_STATUS_DESC[statusResult] || statusResult)}
flicker
/>
<Status type={S2iStatus} name={t(S2I_STATUS_DESC[S2iStatus])} flicker />
</div>
)
}
Expand Down
2 changes: 1 addition & 1 deletion src/utils/status.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const getDeployStatus = ({
'Running'
)
if (s2iStatus !== 'Successful') {
return s2iStatus
return `S2I_${s2iStatus}`
}
}

Expand Down

0 comments on commit 64c3a93

Please sign in to comment.