[ILM] Delete min_age field if warm phase on rollover is enabled (#45412)

This commit is contained in:
Alison Goryachev 2019-09-12 10:26:52 -04:00 committed by GitHub
parent e92857090b
commit 43c033d942
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View file

@ -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`;

View file

@ -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]) {