Skip to content

Commit

Permalink
fix: Fix successThreshold for liveness and startup prob
Browse files Browse the repository at this point in the history
  • Loading branch information
leoliu committed Jul 14, 2020
1 parent 28a798b commit 15e95eb
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export default class HealthChecker extends React.Component {
name={`${this.prefix}livenessProbe`}
type={t('Container Liveness Check')}
description={t('LIVENESS_PROBE_DESC')}
probType="livenessProbe"
/>
</Form.Item>
<Form.Item
Expand All @@ -61,13 +62,15 @@ export default class HealthChecker extends React.Component {
name={`${this.prefix}readinessProbe`}
type={t('Container Readiness Check')}
description={t('READINESS_PROBE_DESC')}
probType="readinessProbe"
/>
</Form.Item>
<Form.Item className={styles.item} label={t('Container Startup Check')}>
<ProbeInput
name={`${this.prefix}startupProbe`}
type={t('Container Startup Check')}
description={t('STARTUP_PROBE_DESC')}
probType="startupProbe"
/>
</Form.Item>
</Form.Group>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ export default class ProbeForm extends React.Component {
}

render() {
const { className, onCancel } = this.props
const { className, probType, onCancel } = this.props
const { formData, checkerType } = this.state

return (
Expand Down Expand Up @@ -261,6 +261,9 @@ export default class ProbeForm extends React.Component {
name="successThreshold"
defaultValue={1}
min={1}
readOnly={['livenessProbe', 'startupProbe'].includes(
probType
)}
integer
/>
</Form.Item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,12 @@ export default class ProbeInput extends React.Component {
}

renderProbeForm() {
const { value } = this.props
const { probType, value } = this.props
return (
<ProbeForm
className={styles.form}
data={value}
probType={probType}
onSave={this.handleForm}
onCancel={this.hideForm}
/>
Expand Down
7 changes: 4 additions & 3 deletions src/locales/tc/workload.js
Original file line number Diff line number Diff line change
Expand Up @@ -378,9 +378,10 @@ export default {

INITIAL_DELAY_DESC: '在检查其运行状况之前,容器启动后需要等待多长时间。',
TIMEOUT_DESC:
'等待探针完成多长时间。如果超过时间,则认为探测失败。默认为1秒。最小值为1',
PERIOD_SECONDS_DESC: '执行探测的频率(以秒为单位)。默认为10秒。最小值为1',
SUCCESS_THRESHOLD_DESC: '探测失败后,连续最小成功探测为成功。默认值为1。',
'等待探针完成多长时间。如果超过时间,则认为探测失败。默认为1秒。最小值为1。',
PERIOD_SECONDS_DESC: '执行探测的频率(以秒为单位)。默认为10秒。最小值为1。',
SUCCESS_THRESHOLD_DESC:
'探测失败后,连续最小成功探测为成功。默认值为1。最小值为1。存活探针和启动探针内必须为1。',
FAILURE_THRESHOLD_DESC: '探针进入失败状态时需要连续探测失败的最小次数。',

HPA_MSG:
Expand Down
7 changes: 4 additions & 3 deletions src/locales/zh/workload.js
Original file line number Diff line number Diff line change
Expand Up @@ -378,9 +378,10 @@ export default {

INITIAL_DELAY_DESC: '在检查其运行状况之前,容器启动后需要等待多长时间。',
TIMEOUT_DESC:
'等待探针完成多长时间。如果超过时间,则认为探测失败。默认为1秒。最小值为1',
PERIOD_SECONDS_DESC: '执行探测的频率(以秒为单位)。默认为10秒。最小值为1',
SUCCESS_THRESHOLD_DESC: '探测失败后,连续最小成功探测为成功。默认值为1。',
'等待探针完成多长时间。如果超过时间,则认为探测失败。默认为1秒。最小值为1。',
PERIOD_SECONDS_DESC: '执行探测的频率(以秒为单位)。默认为10秒。最小值为1。',
SUCCESS_THRESHOLD_DESC:
'探测失败后,连续最小成功探测为成功。默认值为1。最小值为1。存活探针和启动探针内必须为1。',
FAILURE_THRESHOLD_DESC: '探针进入失败状态时需要连续探测失败的最小次数。',

HPA_MSG:
Expand Down

0 comments on commit 15e95eb

Please sign in to comment.