config

package
v0.9.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreatePFlagsForK8SClient

func CreatePFlagsForK8SClient(set *pflag.FlagSet)

CreatePFlagsForK8SClient adds pflags relevant to the K8S client config

func NewSvcatSDK

func NewSvcatSDK(libraryConfig *LibraryConfig) (*servicecatalog.SDK, error)

NewSvcatSDK creates a service-catalog client from configuration

Types

type ClientConfiguration

type ClientConfiguration struct {
	ClientSettings      *LibraryConfig                                    `mapstructure:"client"`
	Secret              *SecretRef                                        `mapstructure:"secret"`
	K8sClientCreateFunc func(*LibraryConfig) (*servicecatalog.SDK, error) `mapstructure:"-"`
	TargetNamespace     string                                            `mapstructure:"target_namespace"`
}

ClientConfiguration type holds config info for building the k8s service catalog client

func DefaultClientConfiguration

func DefaultClientConfiguration() *ClientConfiguration

DefaultClientConfiguration creates a default config for the K8S client

func (*ClientConfiguration) Validate

func (c *ClientConfiguration) Validate() error

Validate validates the configuration and returns appropriate errors in case it is invalid

type LibraryConfig

type LibraryConfig struct {
	Host             string                             `mapstructure:"host"`
	Timeout          time.Duration                      `mapstructure:"timeout"`
	KubeConfigPath   string                             `mapstructure:"kube_config_path"`
	NewClusterConfig func(string) (*rest.Config, error) `mapstructure:"-"`
}

LibraryConfig configurations for the k8s library

func (*LibraryConfig) Validate

func (r *LibraryConfig) Validate() error

Validate validates the library configurations and returns appropriate errors in case it is invalid

type SecretRef

type SecretRef struct {
	Namespace string
}

SecretRef reference to secret used for broker registration

func (*SecretRef) Validate

func (r *SecretRef) Validate() error

Validate validates the registration details and returns appropriate errors in case it is invalid

type Settings

type Settings struct {
	sbproxy.Settings `mapstructure:",squash"`
	K8S              *ClientConfiguration `mapstructure:"k8s"`
}

Settings type wraps the K8S client configuration

func DefaultSettings added in v0.3.1

func DefaultSettings() *Settings

DefaultSettings returns the default settings for the k8s agent

func NewConfig

func NewConfig(env env.Environment) (*Settings, error)

NewConfig creates Settings from the provided environment

func (*Settings) Validate

func (s *Settings) Validate() error

Validate validates the application settings

Jump to

Keyboard shortcuts

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