-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Remove Beats central management #25696
Remove Beats central management #25696
Conversation
Remove the Kibana beats central management feature as it has been replaced by Fleet.
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
Trends 🧪💚 Flaky test reportTests succeeded. Expand to view the summary
Test stats 🧪
|
@jen-huang do you want to synchronize this removal with fleet or once we are green we can merge it? |
jenkins run tests |
1 similar comment
jenkins run tests |
@michel-laterman Did you rebase with master? I see its the arm CI Job that are failling. |
@ph @michel-laterman Merge at will. On Kibana side we have a draft PR for BCM removal elastic/kibana#99789 already so it should follow closely regardless. |
@@ -61,7 +60,7 @@ func NewConfigBlacklist(cfg ConfigBlacklistSettings) (*ConfigBlacklist, error) { | |||
} | |||
|
|||
// Detect an error if any of the given config blocks is blacklisted | |||
func (c *ConfigBlacklist) Detect(configBlocks api.ConfigBlocks) Errors { | |||
func (c *ConfigBlacklist) Detect(configBlocks ConfigBlocks) Errors { |
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.
@ph @blakerouse Can we remove the filtering for output types (and others) from libbeat as well? These have been introduced in the context of Central Management, in order to disallow some potential risky setting.
Agent should disallow the console
and file
input? Filebeat modules should not be configurable anyways. For customizations we already have capabilities in Agent.
Do I miss something why we should keep 'blacklisting' functionality in libbeat?
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.
I agree we can remove it, but lets keep the PR focus on removing BCM we can do a follow-up to remove the "reject/accept" functionality after we have this merge.
Note this old feature is now unnecessary to keep because of the capabilities
of Elastic Agent.
func defaultConfig() *Config { | ||
return &Config{ | ||
Mode: ModeCentralManagement, |
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.
I don't think this should have many side effects, but it's worth noting that I changed the default mode (also not sure if we should define a Mode
attribute and ModeFleet
constant anymore
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 think the Mode
can be removed as well.
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.
removed
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.
for this removal please update x-pack/elastic-agent/spec/*.yml
then mage update
will need to be run.
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.
done
x-pack/libbeat/management/config.go
Outdated
|
||
data, err := yaml.Marshal(tmp) | ||
// ConfigBlocksEqual returns true if the given config blocks are equal, false if not | ||
func ConfigBlocksEqual(a, b ConfigBlocks) (bool, error) { |
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.
I don't think that this is used by fleet, should it also be removed?
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.
If it's not being used, it should be removed. CI/compiler should complain if you removed too much (I hope).
x-pack/libbeat/management/error.go
Outdated
func (e *Error) EventType() api.EventType { | ||
return ErrorEvent | ||
} | ||
|
||
// MarshalJSON transform an error into a JSON document. | ||
func (e *Error) MarshalJSON() ([]byte, error) { |
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.
Are the MarshalJSON/UnmarshalJSON functions used by fleet?
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.
@blakerouse @michalpristas Any idea?
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.
I do not believe they are used.
Doc build failed with:
The reference to the removed docs is in the Kibana repository. |
Docs will be removed as part of the Kibana PR elastic/kibana#99789 |
x-pack/libbeat/management/error.go
Outdated
@@ -21,58 +17,13 @@ type ErrorType string | |||
// ConfigError is the type of error send when an unpack or a blacklist happen. | |||
var ConfigError = ErrorType("CONFIG") | |||
|
|||
// ErrorEvent is the event type when an error happen. | |||
var ErrorEvent = api.EventType("ERROR") | |||
|
|||
// Error is a config error to be reported to kibana. | |||
type Error struct { |
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.
i winder if we need to keep it here, we are coupling error to type and UUID but Error method just calls Error
of nested one and we dont expose coupled information anywhere.
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.
Good point. It looks that the only reason for having this type was json marshalling/unmarshalling. Might indeed be obsolete as well.
Pinging @elastic/agent (Team:Agent) |
/test |
The packaging problems should be fixed in master by now. |
/test |
1 similar comment
/test |
/package |
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.
code looks ok, i think all things were addressed.
Tested ok, standalone and managed
Remove the Kibana beats central management feature as it has been replaced by Fleet. Remove xpack command injection and replace with an includes mod. Restructure the xpack/libbeat/management module to include all fleet code in the directory (no api or fleet subdirs). (cherry picked from commit 27e76c5) # Conflicts: # x-pack/libbeat/include/include.go # x-pack/libbeat/management/api/enroll_test.go # x-pack/winlogbeat/cmd/root.go
- Update to Go 1.16.4 - Adapt to elastic/beats#25696
- Update to Go 1.16.4 - Adapt to elastic/beats#25696
* Remove Beats central management (#25696) Remove the Kibana beats central management feature as it has been replaced by Fleet. Remove xpack command injection and replace with an includes mod. Restructure the xpack/libbeat/management module to include all fleet code in the directory (no api or fleet subdirs). (cherry picked from commit 27e76c5) # Conflicts: # x-pack/libbeat/include/include.go # x-pack/libbeat/management/api/enroll_test.go # x-pack/winlogbeat/cmd/root.go * Fix cherry-pick Co-authored-by: Michel Laterman <[email protected]> Co-authored-by: michel-laterman <[email protected]>
* Update to elastic/beats@27e76c567711 - Update to Go 1.16.4 - Adapt to elastic/beats#25696 * golint fixes * tests: chown go.sum files go mod download will download all modules, even if they are not used (e.g. dependencies of parts of beats that are not dependencies of apm-server). As such the command may need to update go.sum, so make sure it is owned by the running user. * Add gotestsum to go.mod
- Update to Go 1.16.4 - Adapt to elastic/beats#25696 - golint fixes - Add gotestsum to go.mod - tests: chown go.sum files go mod download will download all modules, even if they are not used (e.g. dependencies of parts of beats that are not dependencies of apm-server). As such the command may need to update go.sum, so make sure it is owned by the running user.
- Update to Go 1.16.4 - Adapt to elastic/beats#25696 - golint fixes - Add gotestsum to go.mod - tests: chown go.sum files go mod download will download all modules, even if they are not used (e.g. dependencies of parts of beats that are not dependencies of apm-server). As such the command may need to update go.sum, so make sure it is owned by the running user.
* Update to elastic/beats@27e76c567711 - Update to Go 1.16.4 - Adapt to elastic/beats#25696 * golint fixes * tests: chown go.sum files go mod download will download all modules, even if they are not used (e.g. dependencies of parts of beats that are not dependencies of apm-server). As such the command may need to update go.sum, so make sure it is owned by the running user. * Add gotestsum to go.mod
What does this PR do?
Remove the Kibana beats central management feature as it has been
replaced by Fleet. Remove xpack command injection and replace with
an includes mod. Restructure the xpack/libbeat/management module
to include all fleet code in the directory (no api or fleet subdirs).
Checklist
I have commented my code, particularly in hard-to-understand areasI have made corresponding change to the default configuration filesI have added tests that prove my fix is effective or that my feature worksCHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.How to test this PR locally
elastic-package stack up --version=8.0.0-SNAPSHOT -v
cd x-pack/elastic-agent && SNAPSHOT=true DEV=true PLATFORMS=darwin mage package
Related issues