conf

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(s *Source) error

Load the global operator configuration.

Types

type OperatorConfig

type OperatorConfig struct {
	// GatewayContainerImage can be used to select alternate container sources.
	GatewayContainerImage string `mapstructure:"gateway-container-image"`
	// GatewayContainerName can be used to set the name of the primary container,
	// the one running gateway, in the pod.
	GatewayContainerName string `mapstructure:"gateway-container-name"`
	// GatewayStorageMountPath is where the storage volume should be mounted to
	GatewayStorageMountPath string `mapstructure:"gateway-storage-path"`
	// GatewayOpenAPIContainerImage can be used to select alternate container sources.
	GatewayOpenAPIContainerImage string `mapstructure:"gateway-openapi-container-image"`
	// GatewayContainerName can be used to set the name of the primary container,
	// the one running gateway, in the pod.
	GatewayOpenAPIContainerName string `mapstructure:"gateway-openapi-container-name"`
	// WorkingNamespace defines the namespace for the operator's internal resources
	WorkingNamespace string `mapstructure:"working-namespace"`
	// LockerConfigMapName defines the name of the ConfigMap used as the backend for the distributed locking
	LockerConfigMapName string `mapstructure:"locker-configmap-name"`
}

OperatorConfig is a type holding general configuration values. Most of the operator code that needs to reference configuration should do so via this type.

func Get

func Get() *OperatorConfig

Get the global operator configuration object.

func (*OperatorConfig) Validate

func (*OperatorConfig) Validate() error

Validate the OperatorConfig returning an error if the config is not directly usable by the operator. This may occur if certain required values are unset or invalid.

type Source

type Source struct {
	// contains filtered or unexported fields
}

Source is how external configuration sources populate the operator config.

func NewSource

func NewSource() *Source

NewSource creates a new Source based on default configuration values.

func (*Source) Flags

func (s *Source) Flags() *pflag.FlagSet

Flags returns a pflag FlagSet populated with flags based on the default configuration. If used, flags allow changing configuration values on the CLI. Once parsed these flags act as a configuration source.

func (*Source) Read

func (s *Source) Read() (*OperatorConfig, error)

Read a new OperatorConfig from all available sources.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL