Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitConfigurationVariables ¶
func InitConfigurationVariables(configs []ConfigurationVariables) error
InitConfigurationVariables according to environment
Types ¶
type ConfigurationVariables ¶
type ConfigurationVariables interface {
LoadFromEnvVars() error
}
ConfigurationVariables is an interface with LoadFromEnvVars method. The method is meant to be implemented as a struct method:
type StructWithVars struct { Var1 string `envconfig:"VAR1"` Var2 string `envconfig:"VAR2"` }
func (swv *StructWithVars) LoadFromEnvVars() error { if err := envconfig.Process("", swv); err != nil { return err } return nil }
type ControllerConfiguration ¶ added in v0.11.0
type ControllerConfiguration struct {
Environment common.Environment `envconfig:"ENVIRONMENT" required:"true"`
}
ControllerConfiguration defines required and common values for the controllers
func (*ControllerConfiguration) LoadFromEnvVars ¶ added in v0.11.0
func (c *ControllerConfiguration) LoadFromEnvVars() error
LoadFromEnvVars for the controller configuration
type ManagerConfiguration ¶
type ManagerConfiguration struct { EnableLeaderElection bool `envconfig:"ENABLE_LEADER_ELECTION" required:"true"` LeaderElectionID string `envconfig:"LEADER_ELECTION_ID" required:"true"` Port int `envconfig:"MANAGER_PORT" default:"9443"` MetricsServerPort int `envconfig:"METRICS_SERVER_PORT" default:"8080"` HealthProbeAddress string `envconfig:"HEALTH_PROBE_ADDRESS" default:":8081"` EnableWebhooks bool `envconfig:"ENABLE_WEBHOOKS" default:"true"` WebhookCertDir string `envconfig:"WEBHOOK_CERT_DIR" default:"/tmp/k8s-webhook-server/serving-certs"` }
ManagerConfiguration defines required variables to configure the environment
func (*ManagerConfiguration) LoadFromEnvVars ¶
func (c *ManagerConfiguration) LoadFromEnvVars() error
LoadFromEnvVars from the Manager
type Namespace ¶
type Namespace string
Namespace defines the namespace type that represents the cluster namespace
type RESTControllerConfiguration ¶
type RESTControllerConfiguration struct { UserID string `envconfig:"USER_ID" required:"true"` UserIDPrefix string `envconfig:"USER_ID_PREFIX" default:""` HTTPRequestTimeout time.Duration `envconfig:"HTTP_REQUEST_TIMEOUT" default:"30s"` }
RESTControllerConfiguration defines a struct with required environment variables for rest controller
func (*RESTControllerConfiguration) LoadFromEnvVars ¶
func (c *RESTControllerConfiguration) LoadFromEnvVars() error
LoadFromEnvVars reads all env vars required
Click to show internal directories.
Click to hide internal directories.