Skip to content
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

Merged
merged 11 commits into from
May 31, 2021
3 changes: 1 addition & 2 deletions x-pack/auditbeat/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ package cmd
import (
auditbeatcmd "github.com/elastic/beats/v7/auditbeat/cmd"
"github.com/elastic/beats/v7/libbeat/cmd"
xpackcmd "github.com/elastic/beats/v7/x-pack/libbeat/cmd"

// Register Auditbeat x-pack modules.
_ "github.com/elastic/beats/v7/x-pack/auditbeat/include"
_ "github.com/elastic/beats/v7/x-pack/libbeat/include"
)

// Name of the beat
Expand All @@ -23,5 +23,4 @@ func init() {
settings := auditbeatcmd.AuditbeatSettings()
settings.ElasticLicensed = true
RootCmd = auditbeatcmd.Initialize(settings)
xpackcmd.AddXPack(RootCmd, auditbeatcmd.Name)
}
3 changes: 1 addition & 2 deletions x-pack/filebeat/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ package cmd
import (
fbcmd "github.com/elastic/beats/v7/filebeat/cmd"
cmd "github.com/elastic/beats/v7/libbeat/cmd"
xpackcmd "github.com/elastic/beats/v7/x-pack/libbeat/cmd"

// Register the includes.
_ "github.com/elastic/beats/v7/x-pack/filebeat/include"
inputs "github.com/elastic/beats/v7/x-pack/filebeat/input/default-inputs"
_ "github.com/elastic/beats/v7/x-pack/libbeat/include"
)

const Name = fbcmd.Name
Expand All @@ -21,6 +21,5 @@ func Filebeat() *cmd.BeatsRootCmd {
settings := fbcmd.FilebeatSettings()
settings.ElasticLicensed = true
command := fbcmd.Filebeat(inputs.Init, settings)
xpackcmd.AddXPack(command, Name)
return command
}
4 changes: 2 additions & 2 deletions x-pack/heartbeat/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ package cmd
import (
heartbeatCmd "github.com/elastic/beats/v7/heartbeat/cmd"
"github.com/elastic/beats/v7/libbeat/cmd"
xpackcmd "github.com/elastic/beats/v7/x-pack/libbeat/cmd"

_ "github.com/elastic/beats/v7/x-pack/libbeat/include"
)

// RootCmd to handle beats cli
Expand All @@ -17,5 +18,4 @@ func init() {
settings := heartbeatCmd.HeartbeatSettings()
settings.ElasticLicensed = true
RootCmd = heartbeatCmd.Initialize(settings)
xpackcmd.AddXPack(RootCmd, heartbeatCmd.Name)
}
4 changes: 2 additions & 2 deletions x-pack/journalbeat/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ package cmd
import (
journalbeatCmd "github.com/elastic/beats/v7/journalbeat/cmd"
"github.com/elastic/beats/v7/libbeat/cmd"
xpackcmd "github.com/elastic/beats/v7/x-pack/libbeat/cmd"

_ "github.com/elastic/beats/v7/x-pack/libbeat/include"
)

// RootCmd to handle beats cli
Expand All @@ -17,5 +18,4 @@ func init() {
settings := journalbeatCmd.JournalbeatSettings()
settings.ElasticLicensed = true
RootCmd = journalbeatCmd.Initialize(settings)
xpackcmd.AddXPack(RootCmd, journalbeatCmd.Name)
}
131 changes: 0 additions & 131 deletions x-pack/libbeat/cmd/enroll.go

This file was deleted.

13 changes: 2 additions & 11 deletions x-pack/libbeat/cmd/inject.go → x-pack/libbeat/include/include.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.

package cmd
package include

import (
"github.com/elastic/beats/v7/libbeat/cmd"

// register central management
// Register Fleet
_ "github.com/elastic/beats/v7/x-pack/libbeat/management"

// Register fleet
_ "github.com/elastic/beats/v7/x-pack/libbeat/management/fleet"
// register processors
_ "github.com/elastic/beats/v7/x-pack/libbeat/processors/add_cloudfoundry_metadata"
_ "github.com/elastic/beats/v7/x-pack/libbeat/processors/add_nomad_metadata"
Expand All @@ -21,8 +17,3 @@ import (
_ "github.com/elastic/beats/v7/x-pack/libbeat/autodiscover/providers/aws/elb"
_ "github.com/elastic/beats/v7/x-pack/libbeat/autodiscover/providers/nomad"
)

// AddXPack extends the given root folder with XPack features
func AddXPack(root *cmd.BeatsRootCmd, name string) {
root.AddCommand(genEnrollCmd(name, ""))
}
3 changes: 1 addition & 2 deletions x-pack/libbeat/libbeat.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@ import (

"github.com/elastic/beats/v7/libbeat/cmd"
"github.com/elastic/beats/v7/libbeat/mock"
xpackcmd "github.com/elastic/beats/v7/x-pack/libbeat/cmd"
_ "github.com/elastic/beats/v7/x-pack/libbeat/include"
)

// RootCmd to test libbeat
var RootCmd = cmd.GenRootCmdWithSettings(mock.New, mock.Settings)

func main() {
xpackcmd.AddXPack(RootCmd, mock.Name)
if err := RootCmd.Execute(); err != nil {
os.Exit(1)
}
Expand Down
110 changes: 0 additions & 110 deletions x-pack/libbeat/management/api/auth_client.go

This file was deleted.

Loading