Create type ClusterMode string and panic only in the config validation function
This commit is contained in:
@ -10,11 +10,11 @@ type Config struct {
|
||||
// ServiceTemplate Template for auto discovered services
|
||||
ServiceTemplate *core.Service `yaml:"service-template"`
|
||||
|
||||
// ExcludeSuffix Ignore services with this suffix
|
||||
// ExcludeSuffix is a slice of service suffixes that should be ignored
|
||||
ExcludeSuffix []string `yaml:"exclude-suffix"`
|
||||
|
||||
// ClusterMode to authenticate with kubernetes
|
||||
ClusterMode string `yaml:"cluster-mode"`
|
||||
ClusterMode ClusterMode `yaml:"cluster-mode"`
|
||||
|
||||
// Namespaces from which to discover services
|
||||
Namespaces []*NamespaceConfig `yaml:"namespaces"`
|
||||
@ -31,3 +31,11 @@ type NamespaceConfig struct {
|
||||
// HealthAPI URI to append to service to reach health check API
|
||||
HealthAPI string `yaml:"health-api"`
|
||||
}
|
||||
|
||||
// ClusterMode is the mode to use to authenticate to Kubernetes
|
||||
type ClusterMode string
|
||||
|
||||
const (
|
||||
ClusterModeIn ClusterMode = "in"
|
||||
ClusterModeOut ClusterMode = "out"
|
||||
)
|
||||
|
Reference in New Issue
Block a user