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.
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
Refactor and add tests for template and ilm handling. #12065
Refactor and add tests for template and ilm handling. #12065
Changes from 8 commits
e6bb393
bc98f7a
0efa03e
530f6e7
b0e027f
679d402
293210a
e746f1c
331aebd
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Semantic change, bug fix or noop-change? The cfg.Mode is unpacked from the config at the code block right before this check. Does stdSupport act like noopSupport if
cfg.Mode == ModeDisabled
? Or do we want to ensure that Alias/Policy names are set?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.
Noop, the diff is a bit confusing. Basically I only introduce two new public fcts
StdSupport
andNewNoopSupport
as they can be reused in theexport
cmds.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.
Yes, this I noticed. But StdSupport can still be disabled via settings. Is it guaranteed to behave like NoopSupport in this case?
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.
No
StdSupport
does not behave likeNoopSupport
, but itcfg.Mode == ModeDisabled
it still returnsNoopSupport
, see https://github.com/elastic/beats/pull/12065/files/bc98f7a142d53f74138e3e349efc0a7f42f7643f#diff-1cf0f286dd8a8b51745db0683d527a62R80.I simply extracted creating the
StdSupport
into its own method so it is reusable.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.
Yeah, I noticed that DefaultSupport semantics didn't change. I'm just curious if StdSupport behaves correctly if
cfg.Mode == ModeDisabled
on construction. As thestdManager.Enabled
returns false if ModeDisabled, it should behave correcly, though. Yet the other methods do not check the mode and still happily try to execute the commands.This turns the Manager interface more into a protocol in a sense of: The other methods MUST NOT be used if Enabled did return false. This is true in the current code base, but only some internal assumption.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.