Skip to content

Commit

Permalink
[ILM] Delete min_age field if warm phase on rollover is enabled (#45412
Browse files Browse the repository at this point in the history
…) (#45524)
  • Loading branch information
alisonelizabeth authored Sep 12, 2019
1 parent f323a9e commit 67662cf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]) {
Expand Down

0 comments on commit 67662cf

Please sign in to comment.