migrations

package
v2.26.0-rc.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddonMigration

type AddonMigration interface {
	// Targets determines whether a given migration is applicable/relevant to a
	// given addon+cluster combination.
	Targets(cluster *kubermaticv1.Cluster, addonName string) bool
	// PreApply is called before an addon's rendered manifest is applied in a usercluster.
	// It's possible for this to be the initial installation, or any subsequent updates.
	// This function should ensure that the addon can be cleanly applied.
	PreApply(ctx context.Context, log *zap.SugaredLogger, cluster *kubermaticv1.Cluster, seedClient ctrlruntimeclient.Client, userclusterClient ctrlruntimeclient.Client) error
	// PostApply is called right after an addon manifest was applied in a usercluster and
	// can be used to update the Cluster object with new status information or similar.
	PostApply(ctx context.Context, log *zap.SugaredLogger, cluster *kubermaticv1.Cluster, seedClient ctrlruntimeclient.Client, userclusterClient ctrlruntimeclient.Client) error
	// PreRemove is called before an addon is removed from a usercluster.
	PreRemove(ctx context.Context, log *zap.SugaredLogger, cluster *kubermaticv1.Cluster, seedClient ctrlruntimeclient.Client, userclusterClient ctrlruntimeclient.Client) error
	// PostRemove is called right after an addon was either removed (i.e. its manifest was
	// also already removed) or if an addon manifest renders into a empty string (e.g. the
	// csi addon, when CSIDrivers are disabled). This function should clean up what
	// `kubectl apply --prune` would not remove.
	PostRemove(ctx context.Context, log *zap.SugaredLogger, cluster *kubermaticv1.Cluster, seedClient ctrlruntimeclient.Client, userclusterClient ctrlruntimeclient.Client) error
}

func RelevantMigrations

func RelevantMigrations(cluster *kubermaticv1.Cluster, addonName string) AddonMigration

Jump to

Keyboard shortcuts

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