Documentation
¶
Overview ¶
Package clusterimport provides functionality to import existing Talos clusters into Omni.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrValidation = errors.New("validation error")
ErrValidation indicates a validation error.
Functions ¶
func Abort ¶
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
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.