feat: agent metadata with custom collectors
This commit is contained in:
@ -1,8 +1,17 @@
|
||||
package config
|
||||
|
||||
type AgentConfig struct {
|
||||
ReconciliationInterval InterpolatedInt `yaml:"reconciliationInterval"`
|
||||
Controllers ControllersConfig `yaml:"controllers"`
|
||||
ServerURL InterpolatedString `yaml:"serverUrl"`
|
||||
PrivateKeyPath InterpolatedString `yaml:"privateKeyPath"`
|
||||
ReconciliationInterval InterpolatedInt `yaml:"reconciliationInterval"`
|
||||
Controllers ControllersConfig `yaml:"controllers"`
|
||||
Collectors []ShellCollectorConfig `yaml:"collectors"`
|
||||
}
|
||||
|
||||
type ShellCollectorConfig struct {
|
||||
Name InterpolatedString `yaml:"name"`
|
||||
Command InterpolatedString `yaml:"command"`
|
||||
Args InterpolatedStringSlice `yaml:"args"`
|
||||
}
|
||||
|
||||
type ControllersConfig struct {
|
||||
@ -18,10 +27,8 @@ type PersistenceControllerConfig struct {
|
||||
}
|
||||
|
||||
type SpecControllerConfig struct {
|
||||
Enabled InterpolatedBool `yaml:"enabled"`
|
||||
ServerURL InterpolatedString `yaml:"serverUrl"`
|
||||
Enabled InterpolatedBool `yaml:"enabled"`
|
||||
}
|
||||
|
||||
type GatewayControllerConfig struct {
|
||||
Enabled InterpolatedBool `yaml:"enabled"`
|
||||
}
|
||||
@ -34,11 +41,12 @@ type UCIControllerConfig struct {
|
||||
|
||||
func NewDefaultAgentConfig() AgentConfig {
|
||||
return AgentConfig{
|
||||
ServerURL: "http://127.0.0.1:3000",
|
||||
PrivateKeyPath: "agent-key.json",
|
||||
ReconciliationInterval: 5,
|
||||
Controllers: ControllersConfig{
|
||||
Spec: SpecControllerConfig{
|
||||
Enabled: true,
|
||||
ServerURL: "http://127.0.0.1:3000",
|
||||
Enabled: true,
|
||||
},
|
||||
Persistence: PersistenceControllerConfig{
|
||||
Enabled: true,
|
||||
@ -53,5 +61,12 @@ func NewDefaultAgentConfig() AgentConfig {
|
||||
BinPath: "uci",
|
||||
},
|
||||
},
|
||||
Collectors: []ShellCollectorConfig{
|
||||
{
|
||||
Name: "uname",
|
||||
Command: "uname",
|
||||
Args: []string{"-a"},
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user