bootstrap

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: MIT Imports: 45 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClusterNotReadyError = "cluster exists but it is not ready yet"
)

Variables

This section is empty.

Functions

func BootstrapCluster

func BootstrapCluster(runPlural ActionFunc) error

BootstrapCluster bootstraps cluster with Cluster API.

func CheckClusterReadiness

func CheckClusterReadiness(name, namespace string) (bool, error)

CheckClusterReadiness checks if Cluster API cluster is in ready state.

func DestroyCluster

func DestroyCluster(destroy func() error, runPlural ActionFunc) error

DestroyCluster destroys cluster managed by Cluster API.

func ExecuteSteps

func ExecuteSteps(steps []*Step) error

ExecuteSteps of a bootstrap, migration or destroy process.

func GetBootstrapPath

func GetBootstrapPath() (string, error)

GetBootstrapPath returns bootstrap repository path.

func GetProviderTags

func GetProviderTags(prov, cluster string) map[string]string

GetProviderTags returns map of tags to set on provider resources during migration.

func GetStepPath

func GetStepPath(step *Step, defaultPath string) string

GetStepPath returns path from which step will be executed.

func IsClusterPhase

func IsClusterPhase(context, name, namespace string, phase capi.ClusterPhase) (bool, error)

func MigrateCluster

func MigrateCluster(runPlural ActionFunc) error

MigrateCluster migrates existing clusters to Cluster API.

func RunWithTempCredentials

func RunWithTempCredentials(function ActionFunc) error

RunWithTempCredentials is a function wrapper that provides provider-specific flags with credentials that are used during bootstrap and destroy.

Types

type ActionFunc

type ActionFunc func(arguments []string) error

ActionFunc is an action function that is executed as a part of single bootstrap, migrate and destroy step.

type Bootstrap

type Bootstrap struct {
	ClusterAPICluster *api.Values `json:"cluster-api-cluster"`
}

Bootstrap is a representation of existing cluster to be migrated to Cluster API. This data is fetched from provider with migrator tool. See github.com/pluralsh/cluster-api-migration for more details.

type ConditionFunc

type ConditionFunc func() bool

ConditionFunc is a condition function that is checks if step should be executed or skipped.

type HookFunc

type HookFunc func()

type Step

type Step struct {
	Name       string
	Args       []string
	TargetPath string
	Execute    ActionFunc
	Skip       bool
	SkipFunc   ConditionFunc
	Retries    int
	OnError    HookFunc
	OnAfter    HookFunc
	Confirm    string
}

Step is a representation of a single step in a process of bootstrap, migrate and destroy.

func FilterSteps

func FilterSteps(steps []*Step) []*Step

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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