diff options
Diffstat (limited to 'src/go/collectors/go.d.plugin/agent/discovery/sd/kubernetes/config.go')
-rw-r--r-- | src/go/collectors/go.d.plugin/agent/discovery/sd/kubernetes/config.go | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/go/collectors/go.d.plugin/agent/discovery/sd/kubernetes/config.go b/src/go/collectors/go.d.plugin/agent/discovery/sd/kubernetes/config.go new file mode 100644 index 0000000000..684eeb5e50 --- /dev/null +++ b/src/go/collectors/go.d.plugin/agent/discovery/sd/kubernetes/config.go @@ -0,0 +1,37 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package kubernetes + +import "errors" + +type Config struct { + APIServer string `yaml:"api_server"` // TODO: not used + Namespaces []string `yaml:"namespaces"` + Pod *PodConfig `yaml:"pod"` + Service *ServiceConfig `yaml:"service"` +} + +type PodConfig struct { + Tags string `yaml:"tags"` + LocalMode bool `yaml:"local_mode"` + Selector struct { + Label string `yaml:"label"` + Field string `yaml:"field"` + } `yaml:"selector"` +} + +type ServiceConfig struct { + Tags string `yaml:"tags"` + Selector struct { + Label string `yaml:"label"` + Field string `yaml:"field"` + } `yaml:"selector"` +} + +func validateConfig(cfg Config) error { + if cfg.Pod == nil && cfg.Service == nil { + return errors.New("no discoverers configured") + } + + return nil +} |