fleet-server currently only decodes a subset of agent capabilities:
|
// decodeCapabilities converts capability bitmask to human-readable strings |
|
func decodeCapabilities(caps uint64) []string { |
|
var result []string |
|
capMap := map[uint64]string{ |
|
uint64(protobufs.AgentCapabilities_AgentCapabilities_ReportsStatus): "ReportsStatus", |
|
uint64(protobufs.AgentCapabilities_AgentCapabilities_AcceptsRemoteConfig): "AcceptsRemoteConfig", |
|
uint64(protobufs.AgentCapabilities_AgentCapabilities_ReportsEffectiveConfig): "ReportsEffectiveConfig", |
|
uint64(protobufs.AgentCapabilities_AgentCapabilities_ReportsHealth): "ReportsHealth", |
|
uint64(protobufs.AgentCapabilities_AgentCapabilities_ReportsAvailableComponents): "ReportsAvailableComponents", |
|
uint64(protobufs.AgentCapabilities_AgentCapabilities_AcceptsRestartCommand): "AcceptsRestartCommand", |
|
} |
|
for mask, name := range capMap { |
|
if caps&mask != 0 { |
|
result = append(result, name) |
|
} |
|
} |
|
return result |
|
} |
This should be changed to decode all possible settings - ideally the upstream AgentCapabilities_name could be used
fleet-server currently only decodes a subset of agent capabilities:
fleet-server/internal/pkg/api/handleOpAMP.go
Lines 514 to 531 in 52f9cbe
This should be changed to decode all possible settings - ideally the upstream AgentCapabilities_name could be used