diff --git a/client/config/config.go b/client/config/config.go index ec83d0718..ec515ab98 100644 --- a/client/config/config.go +++ b/client/config/config.go @@ -40,4 +40,27 @@ type Config struct { // Node provides the base node Node *structs.Node + + // Options provides arbitrary key-value configuration for nomad internals, + // like fingerprinters and drivers. The format is: + // + // namespace.option = value + Options map[string]string +} + +func NewConfig() Config { + config := Config{ + Node: &structs.Node{}, + Options: map[string]string{}, + } + return config +} + +// GetOpt returns the specified configuration value or "". +func (c *Config) Read(id string) string { + val, ok := c.Options[id] + if !ok { + return "" + } + return val }