From 67662cfbfe1003a21c76316341b6d8d44e21f7d0 Mon Sep 17 00:00:00 2001 From: Alison Goryachev Date: Thu, 12 Sep 2019 12:16:16 -0400 Subject: [PATCH] [ILM] Delete min_age field if warm phase on rollover is enabled (#45412) (#45524) --- .../public/sections/edit_policy/edit_policy.js | 2 +- .../public/store/selectors/policies.js | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/x-pack/legacy/plugins/index_lifecycle_management/public/sections/edit_policy/edit_policy.js b/x-pack/legacy/plugins/index_lifecycle_management/public/sections/edit_policy/edit_policy.js index 5cf5c47ec6ac3..2b07e9615030f 100644 --- a/x-pack/legacy/plugins/index_lifecycle_management/public/sections/edit_policy/edit_policy.js +++ b/x-pack/legacy/plugins/index_lifecycle_management/public/sections/edit_policy/edit_policy.js @@ -111,7 +111,7 @@ export class EditPolicy extends Component { if (firstError) { toastNotifications.addDanger( i18n.translate('xpack.indexLifecycleMgmt.editPolicy.formErrorsMessage', { - defaultMessage: 'Please fix the errors on this page.' + defaultMessage: 'Please fix the errors on this page.' }) ); const errorRowId = `${firstError.replace('.', '-')}-row`; diff --git a/x-pack/legacy/plugins/index_lifecycle_management/public/store/selectors/policies.js b/x-pack/legacy/plugins/index_lifecycle_management/public/store/selectors/policies.js index 2a824471586f2..e01f94c326ff3 100644 --- a/x-pack/legacy/plugins/index_lifecycle_management/public/store/selectors/policies.js +++ b/x-pack/legacy/plugins/index_lifecycle_management/public/store/selectors/policies.js @@ -239,6 +239,13 @@ export const phaseToES = (phase, originalEsPhase) => { esPhase.min_age = `${phase[PHASE_ROLLOVER_MINIMUM_AGE]}${phase[PHASE_ROLLOVER_MINIMUM_AGE_UNITS]}`; } + // If warm phase on rollover is enabled, delete min age field + // An index lifecycle switches to warm phase when rollover occurs, so you cannot specify a warm phase time + // They are mutually exclusive + if (phase[WARM_PHASE_ON_ROLLOVER]) { + delete esPhase.min_age; + } + esPhase.actions = esPhase.actions || {}; if (phase[PHASE_ROLLOVER_ENABLED]) {