Skip to content

Commit 3fb4d1a

Browse files
Chane fleetmode detection to ony use management.enabled (#26180) (#26211)
Fleetmode detection has been changed ton only use the enabled flag as fleet is now the only management mode available. (cherry picked from commit 689a746) Co-authored-by: Michel Laterman <[email protected]>
1 parent ac0ef8c commit 3fb4d1a

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

libbeat/common/fleetmode/fleet_mode.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,10 @@ import (
2525

2626
// Enabled checks to see if filebeat/metricbeat is running under Agent
2727
// The management setting is stored in the main Beat runtime object, but we can't see that from a module
28-
// So instead we check the CLI flags, since Agent starts filebeat/metricbeat with "-E", "management.mode=x-pack-fleet", "-E", "management.enabled=true"
28+
// So instead we check the CLI flags, since Agent starts filebeat/metricbeat with "-E", "management.enabled=true"
2929
func Enabled() bool {
3030
type management struct {
31-
Mode string `config:"management.mode"`
32-
Enabled bool `config:"management.enabled"`
31+
Enabled bool `config:"management.enabled"`
3332
}
3433
var managementSettings management
3534

@@ -46,8 +45,5 @@ func Enabled() bool {
4645
return false
4746
}
4847

49-
if managementSettings.Enabled == true && managementSettings.Mode == "x-pack-fleet" {
50-
return true
51-
}
52-
return false
48+
return managementSettings.Enabled
5349
}

0 commit comments

Comments
 (0)