config

package
v2.0.0-alpha.4 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OperatorModeWatchers = OperatorMode(1 << iota)
	OperatorModeWebhooks

	OperatorModeBoth = OperatorModeWatchers | OperatorModeWebhooks
)
View Source
const (
	SubscriptionIDVar = "AZURE_SUBSCRIPTION_ID"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type OperatorMode

type OperatorMode int

OperatorMode determines whether we'll run watchers and/or webhooks.

func ParseOperatorMode

func ParseOperatorMode(value string) (OperatorMode, error)

ParseOperatorMode converts a string value into the corresponding operator mode.

func (OperatorMode) IncludesWatchers

func (m OperatorMode) IncludesWatchers() bool

IncludesWatchers returns whether an operator running in this mode should register reconcilers.

func (OperatorMode) IncludesWebhooks

func (m OperatorMode) IncludesWebhooks() bool

IncludesWebhooks returns whether an operator running in this mode should register webhooks.

func (OperatorMode) String

func (m OperatorMode) String() string

String converts the mode into a readable value.

type Values

type Values struct {
	// SubscriptionID is the Azure subscription the operator will use
	// for ARM communication.
	SubscriptionID string

	// PodNamespace is the namespace the operator pods are running in.
	PodNamespace string

	// OperatorMode determines whether the operator should run
	// watchers, webhooks or both.
	OperatorMode OperatorMode

	// TargetNamespaces lists the namespaces the operator will watch
	// for Azure resources (if the mode includes running watchers). If
	// it's empty the operator will watch all namespaces.
	TargetNamespaces []string
}

Values stores configuration values that are set for the operator.

func ReadAndValidate

func ReadAndValidate() (Values, error)

ReadAndValidate loads the configuration values and checks that they're consistent.

func ReadFromEnvironment

func ReadFromEnvironment() (Values, error)

ReadFromEnvironment loads configuration values from the AZURE_* environment variables.

func (Values) Validate

func (v Values) Validate() error

Validate checks whether the configuration settings are consistent.

Jump to

Keyboard shortcuts

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