From 15e95eb85abcdb1bd52193d0a3384a37f70dd0be Mon Sep 17 00:00:00 2001 From: leoliu Date: Tue, 14 Jul 2020 11:31:25 +0800 Subject: [PATCH] fix: Fix successThreshold for liveness and startup prob --- .../ContainerForm/HealthChecker/index.jsx | 3 +++ .../ContainerSettings/ContainerForm/ProbeForm/index.jsx | 5 ++++- .../ContainerSettings/ContainerForm/ProbeInput/index.jsx | 3 ++- src/locales/tc/workload.js | 7 ++++--- src/locales/zh/workload.js | 7 ++++--- 5 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/components/Forms/Workload/ContainerSettings/ContainerForm/HealthChecker/index.jsx b/src/components/Forms/Workload/ContainerSettings/ContainerForm/HealthChecker/index.jsx index 544306d2102..90d0750d2e9 100644 --- a/src/components/Forms/Workload/ContainerSettings/ContainerForm/HealthChecker/index.jsx +++ b/src/components/Forms/Workload/ContainerSettings/ContainerForm/HealthChecker/index.jsx @@ -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" /> @@ -68,6 +70,7 @@ export default class HealthChecker extends React.Component { name={`${this.prefix}startupProbe`} type={t('Container Startup Check')} description={t('STARTUP_PROBE_DESC')} + probType="startupProbe" /> diff --git a/src/components/Forms/Workload/ContainerSettings/ContainerForm/ProbeForm/index.jsx b/src/components/Forms/Workload/ContainerSettings/ContainerForm/ProbeForm/index.jsx index 06705b8adcd..1142835de20 100644 --- a/src/components/Forms/Workload/ContainerSettings/ContainerForm/ProbeForm/index.jsx +++ b/src/components/Forms/Workload/ContainerSettings/ContainerForm/ProbeForm/index.jsx @@ -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 ( @@ -261,6 +261,9 @@ export default class ProbeForm extends React.Component { name="successThreshold" defaultValue={1} min={1} + readOnly={['livenessProbe', 'startupProbe'].includes( + probType + )} integer /> diff --git a/src/components/Forms/Workload/ContainerSettings/ContainerForm/ProbeInput/index.jsx b/src/components/Forms/Workload/ContainerSettings/ContainerForm/ProbeInput/index.jsx index 13dc9f7b75a..fbee9b4e319 100644 --- a/src/components/Forms/Workload/ContainerSettings/ContainerForm/ProbeInput/index.jsx +++ b/src/components/Forms/Workload/ContainerSettings/ContainerForm/ProbeInput/index.jsx @@ -126,11 +126,12 @@ export default class ProbeInput extends React.Component { } renderProbeForm() { - const { value } = this.props + const { probType, value } = this.props return ( diff --git a/src/locales/tc/workload.js b/src/locales/tc/workload.js index 1ce47996176..649577b74f4 100644 --- a/src/locales/tc/workload.js +++ b/src/locales/tc/workload.js @@ -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: diff --git a/src/locales/zh/workload.js b/src/locales/zh/workload.js index 4ad5c436dc3..d6a7c9c6750 100644 --- a/src/locales/zh/workload.js +++ b/src/locales/zh/workload.js @@ -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: