0
0
Fork 0
mirror of https://github.com/crazy-max/diun.git synced 2025-01-27 01:08:50 +00:00
crazy-max_diun/internal/model/provider_kubernetes.go
CrazyMax dc5949819b Allow to define namespaces for Kubernetes
Use annotations instead of labels for Kubernetes
Add Kubernetes provider doc
2020-06-17 01:03:09 +00:00

29 lines
1.1 KiB
Go

package model
import (
"github.com/crazy-max/diun/v4/pkg/utl"
)
// PrdKubernetes holds kubernetes provider configuration
type PrdKubernetes struct {
Endpoint string `yaml:"endpoint" json:"endpoint,omitempty" validate:"omitempty"`
Token string `yaml:"token,omitempty" json:"token,omitempty" validate:"omitempty"`
TokenFile string `yaml:"tokenFile,omitempty" json:"tokenFile,omitempty" validate:"omitempty,file"`
CertAuthFilePath string `yaml:"certAuthFilePath" json:"certAuthFilePath,omitempty" validate:"omitempty"`
TLSInsecure *bool `yaml:"tlsInsecure" json:"tlsInsecure,omitempty" validate:"required"`
Namespaces []string `yaml:"namespaces" json:"namespaces,omitempty" validate:"omitempty"`
WatchByDefault *bool `yaml:"watchByDefault" json:"watchByDefault,omitempty" validate:"required"`
}
// GetDefaults gets the default values
func (s *PrdKubernetes) GetDefaults() *PrdKubernetes {
n := &PrdKubernetes{}
n.SetDefaults()
return n
}
// SetDefaults sets the default values
func (s *PrdKubernetes) SetDefaults() {
s.TLSInsecure = utl.NewFalse()
s.WatchByDefault = utl.NewFalse()
}