upgradeconfigmanager

package
v0.0.0-...-17ef94a Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// UPGRADECONFIG_CR_NAME is the name of the Custom Resource that the provider will manage
	UPGRADECONFIG_CR_NAME = "managed-upgrade-config"
	// JITTER_FACTOR is a jitter factor (percentage / 100) used to alter watch interval
	JITTER_FACTOR = 0.1
	// INITIAL_SYNC_DURATION is an initial sync duration
	INITIAL_SYNC_DURATION = 1 * time.Minute
	// ERROR_RETRY_DURATION is an error retryn duration
	ERROR_RETRY_DURATION = 5 * time.Minute
)

Variables

View Source
var (
	ErrClusterIsUpgrading       = fmt.Errorf("cluster is upgrading")
	ErrRetrievingUpgradeConfigs = fmt.Errorf("unable to retrieve upgradeconfigs")
	ErrMissingOperatorNamespace = fmt.Errorf("can't determine operator namespace, missing env OPERATOR_NAMESPACE")
	ErrProviderSpecPull         = fmt.Errorf("unable to retrieve upgrade spec")
	ErrRemovingUpgradeConfig    = fmt.Errorf("unable to remove existing UpgradeConfig")
	ErrCreatingUpgradeConfig    = fmt.Errorf("unable to create new UpgradeConfig")
	ErrUpgradeConfigNotFound    = fmt.Errorf("upgrade config not found")
	ErrNotConfigured            = fmt.Errorf("no upgrade config manager configured")
)

Errors

View Source
var ErrNoConfigManagerDefined = fmt.Errorf("no configManager defined in configuration")

ErrNoConfigManagerDefined is an error that describes no configmanager has been configured

Functions

This section is empty.

Types

type ConfigManager

type ConfigManager struct {
	WatchIntervalMinutes int `yaml:"watchInterval" default:"1"`
}

ConfigManager holds fileds that describe a ConfigManager

type ConfigManagerSource

type ConfigManagerSource string

ConfigManagerSource is a type illustrating a config manager source

type UpgradeConfigManager

type UpgradeConfigManager interface {
	Get() (*upgradev1alpha1.UpgradeConfig, error)
	StartSync(stopCh context.Context)
	Refresh() (bool, error)
}

UpgradeConfigManager enables an implementation of an UpgradeConfigManager

type UpgradeConfigManagerBuilder

type UpgradeConfigManagerBuilder interface {
	NewManager(client.Client) (UpgradeConfigManager, error)
}

UpgradeConfigManagerBuilder enables an implementation of an UpgradeConfigManagerBuilder

func NewBuilder

func NewBuilder() UpgradeConfigManagerBuilder

NewBuilder returns an upgradeConfigManagerBuilder

type UpgradeConfigManagerConfig

type UpgradeConfigManagerConfig struct {
	ConfigManager ConfigManager `yaml:"configManager"`
}

UpgradeConfigManagerConfig holds fields that describe an UpgradeConfigManagerConfig

func (*UpgradeConfigManagerConfig) GetWatchInterval

func (cfg *UpgradeConfigManagerConfig) GetWatchInterval() time.Duration

GetWatchInterval returns the WatchIntervalMinutes field from an UpgradeConfigManagerConfig

func (*UpgradeConfigManagerConfig) IsValid

func (cfg *UpgradeConfigManagerConfig) IsValid() error

IsValid returns a nil error when the UpgradeConfigManagerConfig is valid

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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