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. |
|
|
||
| // 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.
@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.
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.
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.
Yeah, I think the Mode can be removed as well.
There was a problem hiding this comment.
for this removal please update x-pack/elastic-agent/spec/*.yml then mage update will need to be run.
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.
I don't think that this is used by fleet, should it also be removed?
There was a problem hiding this comment.
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
| } | ||
|
|
||
| // MarshalJSON transform an error into a JSON document. | ||
| func (e *Error) MarshalJSON() ([]byte, error) { |
There was a problem hiding this comment.
Are the MarshalJSON/UnmarshalJSON functions used by fleet?
There was a problem hiding this comment.
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
| 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.
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.
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 |
michalpristas
left a comment
There was a problem hiding this comment.
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 <82832767+michel-laterman@users.noreply.github.com> Co-authored-by: michel-laterman <michel.laterman@elastic.co>
* 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.asciidocorCHANGELOG-developer.next.asciidoc.How to test this PR locally
elastic-package stack up --version=8.0.0-SNAPSHOT -vcd x-pack/elastic-agent && SNAPSHOT=true DEV=true PLATFORMS=darwin mage packageRelated issues