Add [master] config section to agent for registration
Heartbeat client now reads master connection settings from the agent config ([master] section) with env var fallback. Includes address, ca_cert, token_path, and role fields. Agent's Run() creates and starts the heartbeat client automatically when [master] is configured. Tested on all three nodes: rift (master), svc (edge), orion (worker) all registered with the master and sending heartbeats every 30s. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -19,7 +19,17 @@ type AgentConfig struct {
|
||||
MCNS MCNSConfig `toml:"mcns"`
|
||||
Monitor MonitorConfig `toml:"monitor"`
|
||||
Log LogConfig `toml:"log"`
|
||||
Boot BootConfig `toml:"boot"`
|
||||
Boot BootConfig `toml:"boot"`
|
||||
Master AgentMasterConfig `toml:"master"`
|
||||
}
|
||||
|
||||
// AgentMasterConfig holds the optional master connection settings.
|
||||
// When configured, the agent self-registers and sends heartbeats.
|
||||
type AgentMasterConfig struct {
|
||||
Address string `toml:"address"` // master gRPC address
|
||||
CACert string `toml:"ca_cert"` // CA cert to verify master's TLS
|
||||
TokenPath string `toml:"token_path"` // MCIAS service token for auth
|
||||
Role string `toml:"role"` // "worker", "edge", or "master"
|
||||
}
|
||||
|
||||
// BootConfig holds the boot sequence for the master node.
|
||||
|
||||
Reference in New Issue
Block a user