backport to 1.17: outlier_detector: accept large base_ejection_time when max_ejection_time not specified (#14962) #15155
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Commit Message:
backport to 1.17:
accept large base_ejection_time when max_ejection_time not specified
Additional Description:
PR #14235 broke compatibility with istio. Istio sets large base_ejection_time and configs where max_jection_time was not specified were rejected. That scenario happened during upgrade from istio 1.8 to 1.9. See #14235 (comment).
This PR changes the logic to following:
if both base_ejection_time and max_ejection_time are specified in the config, they are compared and config is rejected when max_ejection_time is smaller than base_ejection_time.
if max_ejection_time is missing in the config, the default value of 300s is applied. If base_ejection_time is larger than 300s, then max_ejection_time is initialized to base_ejection_time.
Risk Level: Low
Testing: Added unit test to simulate receiving config without max_ejection_time and with large base_ejection_time.
Docs Changes: No
Release Notes: No
Platform Specific Features: