configloader

package module
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: Apache-2.0 Imports: 8 Imported by: 4

Documentation

Index

Constants

View Source
const (
	DefaultCloudProviderConfigSecName      = "azure-cloud-provider"
	DefaultCloudProviderConfigSecNamespace = "kube-system"
	DefaultCloudProviderConfigSecKey       = "cloud-config"
)

cloud provider config secret

Variables

View Source
var (
	ErrNoKubeClient = errors.New("no kube client provided")
	ErrNoData       = errors.New("no data in secret")
)

Functions

func Load

func Load[Type any](ctx context.Context, secretLoaderConfig *K8sSecretLoaderConfig, fileLoaderConfig *FileLoaderConfig) (*Type, error)

Types

type CloudConfigType

type CloudConfigType string

The config type for Azure cloud provider secret. Supported values are: * file : The values are read from local cloud-config file. * secret : The values from secret would override all configures from local cloud-config file. * merge : The values from secret would override only configurations that are explicitly set in the secret. This is the default value.

const (
	CloudConfigTypeFile   CloudConfigType = "file"
	CloudConfigTypeSecret CloudConfigType = "secret"
	CloudConfigTypeMerge  CloudConfigType = "merge"
)

type ConfigMergeConfig

type ConfigMergeConfig struct {
	// The cloud configure type for Azure cloud provider. Supported values are file, secret and merge.
	CloudConfigType CloudConfigType `json:"cloudConfigType,omitempty" yaml:"cloudConfigType,omitempty"`
}

type FileLoader

type FileLoader[Type any] struct {
	// contains filtered or unexported fields
}

func (*FileLoader[Type]) Load

func (f *FileLoader[Type]) Load(ctx context.Context) (*Type, error)

type FileLoaderConfig

type FileLoaderConfig struct {
	FilePath string
}

type K8sSecretConfig

type K8sSecretConfig struct {
	SecretName      string `json:"secretName,omitempty" yaml:"secretName,omitempty"`
	SecretNamespace string `json:"secretNamespace,omitempty" yaml:"secretNamespace,omitempty"`
	CloudConfigKey  string `json:"cloudConfigKey,omitempty" yaml:"cloudConfigKey,omitempty"`
}

type K8sSecretLoaderConfig

type K8sSecretLoaderConfig struct {
	K8sSecretConfig
	KubeClient clientset.Interface
}

Jump to

Keyboard shortcuts

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