processor

package
v1.14.1-0...-7f8ff72 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2024 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RunGuestFailed = "RunGuestFailed"
)

Variables

View Source
var ErrCancelled = errors.New("cancelled")
View Source
var ForceDelete bool
View Source
var ForceOverride bool

Functions

func ConfirmDeleteNodes

func ConfirmDeleteNodes() error

func GetCommands

func GetCommands(ctx context.Context) []string

func GetEnvs

func GetEnvs(ctx context.Context) map[string]string

func IsRunGuestFailed

func IsRunGuestFailed(err error) bool

func MirrorRegistry

func MirrorRegistry(cluster *v2.Cluster, mounts []v2.MountImage) error

func MountClusterImages

func MountClusterImages(bdah buildah.Interface, cluster *v2.Cluster, skipApp bool) error

func NewCheckError

func NewCheckError(err error) error

func NewPreProcessError

func NewPreProcessError(err error) error

func OCIToImageMount

func OCIToImageMount(inspector imageInspector, mount *v2.MountImage) error

func SyncClusterStatus

func SyncClusterStatus(cluster *v2.Cluster, bdah buildah.Interface, reset bool) error

func SyncNewVersionConfig

func SyncNewVersionConfig(clusterName string)

compatible with older sealos versions

func WithCommands

func WithCommands(ctx context.Context, commands []string) context.Context

func WithEnvs

func WithEnvs(ctx context.Context, envs map[string]string) context.Context

Types

type CheckError

type CheckError struct {
	// contains filtered or unexported fields
}

func (*CheckError) Error

func (e *CheckError) Error() string

type CreateProcessor

type CreateProcessor struct {
	ClusterFile clusterfile.Interface
	Buildah     buildah.Interface
	Runtime     runtime.Interface
	Guest       guest.Interface
	ExtraEnvs   map[string]string // parsing from CLI arguments
}

func (*CreateProcessor) Bootstrap

func (c *CreateProcessor) Bootstrap(cluster *v2.Cluster) error

func (*CreateProcessor) Check

func (c *CreateProcessor) Check(cluster *v2.Cluster) error

func (*CreateProcessor) Execute

func (c *CreateProcessor) Execute(cluster *v2.Cluster) error

func (*CreateProcessor) GetPipeLine

func (c *CreateProcessor) GetPipeLine() ([]func(cluster *v2.Cluster) error, error)

func (*CreateProcessor) Init

func (c *CreateProcessor) Init(_ *v2.Cluster) error

func (*CreateProcessor) Join

func (c *CreateProcessor) Join(cluster *v2.Cluster) error

func (*CreateProcessor) MirrorRegistry

func (c *CreateProcessor) MirrorRegistry(cluster *v2.Cluster) error

func (*CreateProcessor) MountRootfs

func (c *CreateProcessor) MountRootfs(cluster *v2.Cluster) error

func (*CreateProcessor) PreProcess

func (c *CreateProcessor) PreProcess(cluster *v2.Cluster) error

func (*CreateProcessor) RunConfig

func (c *CreateProcessor) RunConfig(cluster *v2.Cluster) error

func (*CreateProcessor) RunGuest

func (c *CreateProcessor) RunGuest(cluster *v2.Cluster) error

type DeleteProcessor

type DeleteProcessor struct {
	Buildah     buildah.Interface
	ClusterFile clusterfile.Interface
}

func (*DeleteProcessor) CleanFS

func (d *DeleteProcessor) CleanFS(cluster *v2.Cluster) error

func (DeleteProcessor) Execute

func (d DeleteProcessor) Execute(cluster *v2.Cluster) (err error)

Execute :according to the different of desired cluster to delete cluster.

func (DeleteProcessor) GetPipeLine

func (d DeleteProcessor) GetPipeLine() ([]func(cluster *v2.Cluster) error, error)

func (*DeleteProcessor) PreProcess

func (d *DeleteProcessor) PreProcess(cluster *v2.Cluster) error

func (*DeleteProcessor) Reset

func (d *DeleteProcessor) Reset(cluster *v2.Cluster) error

func (*DeleteProcessor) UnMountImage

func (d *DeleteProcessor) UnMountImage(cluster *v2.Cluster) error

func (*DeleteProcessor) UnMountRootfs

func (d *DeleteProcessor) UnMountRootfs(cluster *v2.Cluster) error

func (*DeleteProcessor) UndoBootstrap

func (d *DeleteProcessor) UndoBootstrap(cluster *v2.Cluster) error

type InstallProcessor

type InstallProcessor struct {
	ClusterFile clusterfile.Interface
	Buildah     buildah.Interface
	Runtime     runtime.Interface
	Guest       guest.Interface
	NewMounts   []v2.MountImage
	NewImages   []string
	ExtraEnvs   map[string]string // parsing from CLI arguments
	// contains filtered or unexported fields
}

func (*InstallProcessor) ConfirmOverrideApps

func (c *InstallProcessor) ConfirmOverrideApps(_ *v2.Cluster) error

func (*InstallProcessor) Execute

func (c *InstallProcessor) Execute(cluster *v2.Cluster) error

func (*InstallProcessor) GetPipeLine

func (c *InstallProcessor) GetPipeLine() ([]func(cluster *v2.Cluster) error, error)

func (*InstallProcessor) MirrorRegistry

func (c *InstallProcessor) MirrorRegistry(cluster *v2.Cluster) error

func (*InstallProcessor) MountRootfs

func (c *InstallProcessor) MountRootfs(cluster *v2.Cluster) error

func (*InstallProcessor) PostProcess

func (c *InstallProcessor) PostProcess(*v2.Cluster) error

func (*InstallProcessor) PreProcess

func (c *InstallProcessor) PreProcess(cluster *v2.Cluster) error

func (*InstallProcessor) RunConfig

func (c *InstallProcessor) RunConfig(_ *v2.Cluster) error

func (*InstallProcessor) RunGuest

func (c *InstallProcessor) RunGuest(cluster *v2.Cluster) error

func (*InstallProcessor) SyncStatusAndCheck

func (c *InstallProcessor) SyncStatusAndCheck(_ *v2.Cluster) error

func (*InstallProcessor) UpgradeIfNeed

func (c *InstallProcessor) UpgradeIfNeed(cluster *v2.Cluster) error

type Interface

type Interface interface {
	// Execute :according to the difference of desired cluster to do cluster apply.
	Execute(cluster *v2.Cluster) error
}

func NewCreateProcessor

func NewCreateProcessor(ctx context.Context, name string, clusterFile clusterfile.Interface) (Interface, error)

func NewDeleteProcessor

func NewDeleteProcessor(name string, clusterFile clusterfile.Interface) (Interface, error)

func NewInstallProcessor

func NewInstallProcessor(ctx context.Context, clusterFile clusterfile.Interface, images []string) (Interface, error)

func NewScaleProcessor

func NewScaleProcessor(clusterFile clusterfile.Interface, name string, images v2.ImageList, masterToJoin, masterToDelete, nodeToJoin, nodeToDelete []string) (Interface, error)

type PreProcessError

type PreProcessError struct {
	// contains filtered or unexported fields
}

func (*PreProcessError) Error

func (e *PreProcessError) Error() string

type ScaleProcessor

type ScaleProcessor struct {
	ClusterFile clusterfile.Interface
	Runtime     runtime.Interface
	Buildah     buildah.Interface

	MastersToJoin   []string
	MastersToDelete []string
	NodesToJoin     []string
	NodesToDelete   []string
	IsScaleUp       bool
	Guest           guest.Interface
	// contains filtered or unexported fields
}

func (*ScaleProcessor) Bootstrap

func (c *ScaleProcessor) Bootstrap(cluster *v2.Cluster) error

func (*ScaleProcessor) Delete

func (c *ScaleProcessor) Delete(cluster *v2.Cluster) error

func (*ScaleProcessor) DeleteCheck

func (c *ScaleProcessor) DeleteCheck(cluster *v2.Cluster) error

func (*ScaleProcessor) Execute

func (c *ScaleProcessor) Execute(cluster *v2.Cluster) error

func (*ScaleProcessor) GetPipeLine

func (c *ScaleProcessor) GetPipeLine() ([]func(cluster *v2.Cluster) error, error)

func (*ScaleProcessor) Join

func (c *ScaleProcessor) Join(cluster *v2.Cluster) error

func (*ScaleProcessor) JoinCheck

func (c *ScaleProcessor) JoinCheck(cluster *v2.Cluster) error

func (*ScaleProcessor) MountRootfs

func (c *ScaleProcessor) MountRootfs(cluster *v2.Cluster) error

func (*ScaleProcessor) PreProcess

func (c *ScaleProcessor) PreProcess(cluster *v2.Cluster) error

func (*ScaleProcessor) PreProcessImage

func (c *ScaleProcessor) PreProcessImage(cluster *v2.Cluster) error

func (*ScaleProcessor) RunConfig

func (c *ScaleProcessor) RunConfig(cluster *v2.Cluster) error

func (*ScaleProcessor) RunGuest

func (c *ScaleProcessor) RunGuest(cluster *v2.Cluster) error

func (ScaleProcessor) UnMountRootfs

func (c ScaleProcessor) UnMountRootfs(cluster *v2.Cluster) error

func (*ScaleProcessor) UndoBootstrap

func (c *ScaleProcessor) UndoBootstrap(_ *v2.Cluster) error

Jump to

Keyboard shortcuts

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