-
Notifications
You must be signed in to change notification settings - Fork 138
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
[RS-1818] Update ILM policy when warm index readonly setting changes #3336
[RS-1818] Update ILM policy when warm index readonly setting changes #3336
Conversation
} | ||
|
||
currentMaxAge := existingPolicy.Phases.Hot.Actions.Rollover.MaxAge | ||
currentMaxSize := existingPolicy.Phases.Hot.Actions.Rollover.MaxSize | ||
currentMinAge := existingPolicy.Phases.Delete.MinAge | ||
return currentMaxAge, currentMaxSize, currentMinAge, nil | ||
readOnlyAfterRollover := existingPolicy.Phases.Warm.Actions.Readonly != nil | ||
return currentMaxAge, currentMaxSize, currentMinAge, readOnlyAfterRollover, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know why we don't just do a rollover if anything has changed, i.e. do some sort of deep equal?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was my thought too when I first saw this, seems like it would be a lot simpler and better long term. But a bigger change could expose me to more unforeseen issues and wanted to keep the change straightforward.
The main issue I could foresee would be sensitivity to json formatting or ordering mismatch could cause the comparison to "fail" and the policy to be continuously updated. This could be avoided with proper testing.
Would be happy to clean that up further if you think that's a good change?
…s-1.34 [RS-1818] Update ILM policy when warm index readonly setting changes
Description
Further testing around #3325 showed that the operator does not update the ILM policy when the value of
readOnlyAfterRollover
changes.The code responsible for updating the ILM policy only do so if there is a change warranting an update. That check does not generically compare the old policy to the new one, but instead only looks at a handful of relevant parameters and tirggers an update only when one of these relevant parameters changes. This PR adds
readOnlyAfterRollover
to that logic and updates the tests to cover that logic.For PR author
make gen-files
make gen-versions
For PR reviewers
A note for code reviewers - all pull requests must have the following:
kind/bug
if this is a bugfix.kind/enhancement
if this is a a new feature.enterprise
if this PR applies to Calico Enterprise only.