inplace

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetUpgradeInstructions

func GetUpgradeInstructions(obj client.Object) string

GetUpgradeInstructions returns the in-place upgrade instructions set on the object.

func IsMachineUpgradeFailed

func IsMachineUpgradeFailed(m *clusterv1.Machine) bool

IsMachineUpgradeFailed checks if the machine upgrade failed. The upgrade might be getting retried at the moment of the check. This check insures that the upgrade failed *at some point*.

func IsMachineUpgrading

func IsMachineUpgrading(m *clusterv1.Machine) bool

IsMachineUpgrading checks if the object is upgrading.

func IsUpgraded

func IsUpgraded(obj client.Object, release string) bool

IsUpgraded checks if the object is already upgraded to the specified release.

func MarkMachineToUpgrade

func MarkMachineToUpgrade(ctx context.Context, m *clusterv1.Machine, to string, c client.Client) error

MarkMachineToUpgrade marks the machine to upgrade.

func MarkUpgradeDone

func MarkUpgradeDone(ctx context.Context, obj client.Object, to string, patcher Patcher) error

MarkUpgradeDone annotates the object with in-place upgrade done.

func MarkUpgradeFailed

func MarkUpgradeFailed(ctx context.Context, obj client.Object, patcher Patcher) error

MarkUpgradeFailed annotates the object with in-place upgrade failed.

func MarkUpgradeInProgress

func MarkUpgradeInProgress(ctx context.Context, obj client.Object, to string, patcher Patcher) error

MarkUpgradeInProgress annotates the object with in-place upgrade in-progress.

func NewUpgradeLock

func NewUpgradeLock(c client.Client) *upgradeLock

Types

type MachineGetter

type MachineGetter interface {
	GetMachinesForCluster(ctx context.Context, cluster client.ObjectKey, filters ...collections.Func) (collections.Machines, error)
}

MachineGetter is an interface that defines the methods used to get machines.

type Patcher

type Patcher interface {
	Patch(ctx context.Context, obj client.Object, opts ...patch.Option) error
}

Patcher is an interface that knows how to patch an object.

type UpgradeLock

type UpgradeLock interface {
	// IsLocked checks if the upgrade process is locked and (if locked) returns the machine that the process is locked for.
	IsLocked(ctx context.Context, cluster *clusterv1.Cluster) (*clusterv1.Machine, error)
	// Lock is a non-blocking call that tries to lock the upgrade process for the given machine.
	Lock(ctx context.Context, cluster *clusterv1.Cluster, m *clusterv1.Machine) error
	// Unlock unlocks the upgrade process.
	Unlock(ctx context.Context, cluster *clusterv1.Cluster) error
}

UpgradeLock is an interface that defines the methods used to lock and unlock the inplace upgrade process.

Jump to

Keyboard shortcuts

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