config

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(source string, targets ...string) connection.MultiClusterClient

New creates new fake config with prepopulated parameters

func NewFakeConfig

func NewFakeConfig(source string, targets ...string) connection.MultiClusterClient

NewFakeConfig returns new FakeClient with initialized fake remote clients

func NewFakeConfigForSingleCluster

func NewFakeConfigForSingleCluster(selfClient client.Client, source string, targets ...string) connection.MultiClusterClient

NewFakeConfigForSingleCluster returns new FakeClient configured to be used in single-cluster scenario

Types

type Config

type Config struct {
	LogLevel string
	Lock     sync.Mutex
	// contains filtered or unexported fields
}

Config structure that combines replication configuration and current log level

func GetConfig

func GetConfig(ctx context.Context, client ctrlClient.Client, opts ControllerManagerOpts, recorder record.EventRecorder, log logr.Logger) (*Config, error)

GetConfig returns new instance of replication config

func (*Config) GetClusterID added in v1.1.0

func (c *Config) GetClusterID() string

GetClusterID returns cluster ID for config instance

func (*Config) GetConnection

func (c *Config) GetConnection(clusterID string) (connection.RemoteClusterClient, error)

GetConnection returns cluster client for given cluster ID

func (*Config) PrintConfig

func (c *Config) PrintConfig(log logr.Logger)

PrintConfig prints current config information using provided logger interface

func (*Config) UpdateConfigMap

func (c *Config) UpdateConfigMap(ctx context.Context, client ctrlClient.Client, opts ControllerManagerOpts, recorder record.EventRecorder, log logr.Logger) error

UpdateConfigMap updates config instance by reading mounted config

func (*Config) UpdateConfigOnSecretEvent

func (c *Config) UpdateConfigOnSecretEvent(ctx context.Context, client ctrlClient.Client, opts ControllerManagerOpts, secretName string, recorder record.EventRecorder, log logr.Logger) error

UpdateConfigOnSecretEvent updates config instance if update to currently used secret was made

type ControllerManagerOpts

type ControllerManagerOpts struct {
	UseConfFileFormat bool
	WatchNamespace    string
	ConfigDir         string
	ConfigFileName    string
	InCluster         bool
	Mode              string
}

ControllerManagerOpts - Controller Manager configuration

func GetControllerManagerOpts

func GetControllerManagerOpts() ControllerManagerOpts

GetControllerManagerOpts initializes and returns new ControllerManagerOpts object

type FakeConfig

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

FakeConfig is a structure that implements MultiClusterClient interface providing dummy functionality

func (*FakeConfig) GetClusterID added in v1.1.0

func (c *FakeConfig) GetClusterID() string

GetClusterID returns ID of fake cluster

func (*FakeConfig) GetConnection

func (c *FakeConfig) GetConnection(clusterID string) (connection.RemoteClusterClient, error)

GetConnection returns fake connection remote client

Jump to

Keyboard shortcuts

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