Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,7 +239,14 @@ export const phaseToES = (phase, originalEsPhase) => {
esPhase.min_age = `${phase[PHASE_ROLLOVER_MINIMUM_AGE]}${phase[PHASE_ROLLOVER_MINIMUM_AGE_UNITS]}`;
}

esPhase.actions = esPhase.actions || {};
// 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 || {};}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, actually, I just noticed this. Why is this wrapped in braces?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strange! That was not intentional. Thanks for catching this! I removed it and did some quick manual testing again to verify everything is still working as expected.


if (phase[PHASE_ROLLOVER_ENABLED]) {
esPhase.actions.rollover = {};
Expand Down