clusterimport

package
v1.6.0-beta.3 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2026 License: MPL-2.0 Imports: 42 Imported by: 0

Documentation

Overview

Package clusterimport provides functionality to import existing Talos clusters into Omni.

Index

Constants

This section is empty.

Variables

View Source
var ErrValidation = errors.New("validation error")

ErrValidation indicates a validation error.

Functions

func Abort

func Abort(ctx context.Context, omniState state.State, clusterID string, logWriter io.Writer) error

Abort stops the import operation for a cluster by validating its locked and tainted statuses, tearing down resources, and cleaning up machine-set node links.

func BuildImageFactoryClient

func BuildImageFactoryClient(ctx context.Context, omniState state.State) (*imagefactory.Client, error)

BuildImageFactoryClient builds an Image Factory client using the Image Factory base url from Omni configuration.

Types

type Context

type Context struct {
	ClusterID string
	// contains filtered or unexported fields
}

Context holds the state for the import operation.

func BuildContext

func BuildContext(ctx context.Context, input Input, omniState state.State, imageFactoryClient ImageFactoryClient, talosClient TalosClient) (*Context, error)

BuildContext builds the import context by collecting information from the existing Talos cluster. nolint:gocyclo,cyclop

func (*Context) Close

func (c *Context) Close() error

func (*Context) Run

func (c *Context) Run(ctx context.Context) error

Run executes the import operation.

type ImageFactoryClient

type ImageFactoryClient interface {
	EnsureSchematic(ctx context.Context, schematic schematic.Schematic) (string, error)
}

ImageFactoryClient is a minimal interface for Image Factory client used in cluster import.

type Input

type Input struct {
	LogWriter       io.Writer
	Versions        Versions
	BackupOutput    string
	Nodes           []string
	Force           bool
	DryRun          bool
	SkipHealthCheck bool
}

Input represents the input parameters required for importing a Talos cluster into Omni.

type TalosClient

type TalosClient interface {
	io.Closer
	state.State
	Version(ctx context.Context, callOptions ...grpc.CallOption) (*machineapi.VersionResponse, error)
	ClusterHealthCheck(ctx context.Context, waitTimeout time.Duration, clusterInfo *clusterapi.ClusterInfo) (clusterapi.ClusterService_HealthCheckClient, error)
	ApplyConfiguration(ctx context.Context, req *machineapi.ApplyConfigurationRequest, callOptions ...grpc.CallOption) (*machineapi.ApplyConfigurationResponse, error)
}

TalosClient is a minimal interface for Talos client used in cluster import.

func BuildTalosClient

func BuildTalosClient(ctx context.Context, config, context, sideroV1KeysDir string, endpoints []string) (TalosClient, error)

BuildTalosClient builds a Talos client for the given cluster using the provided parameters.

type Versions

type Versions struct {
	InitialTalosVersion      string
	TalosVersion             string
	InitialKubernetesVersion string
	KubernetesVersion        string
}

Jump to

Keyboard shortcuts

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