processor

package
v0.8.7 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateCluster

func GenerateCluster(arg *ParserArg) (*v2.Cluster, error)

Types

type CreateProcessor

type CreateProcessor struct {
	ClusterFile  clusterfile.Interface
	ImageManager image.Service

	Runtime runtime.Interface
	Guest   guest.Interface
	Config  config.Interface
	Plugins plugin.Plugins
	// contains filtered or unexported fields
}

func (*CreateProcessor) GetPhasePluginFunc

func (c *CreateProcessor) GetPhasePluginFunc(phase plugin.Phase) func(cluster *v2.Cluster) error

func (*CreateProcessor) GetPipeLine

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

func (*CreateProcessor) Init

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

func (*CreateProcessor) Join

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

func (*CreateProcessor) MountImage

func (c *CreateProcessor) MountImage(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

func (*CreateProcessor) UnMountImage

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

type DeleteProcessor

type DeleteProcessor struct {
	ClusterFile clusterfile.Interface
	Plugins     plugin.Plugins
	// contains filtered or unexported fields
}

func (*DeleteProcessor) CleanFS

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

func (*DeleteProcessor) GetPhasePluginFunc

func (d *DeleteProcessor) GetPhasePluginFunc(phase plugin.Phase) func(cluster *v2.Cluster) error

func (*DeleteProcessor) GetPipeLine

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

func (*DeleteProcessor) InitPlugin

func (d *DeleteProcessor) InitPlugin(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

type Executor

type Executor struct {
	Processor
}

func (*Executor) Execute

func (e *Executor) Execute(cluster *v2.Cluster) error

type GenerateProcessor

type GenerateProcessor struct {
	Runtime      *runtime.KubeadmRuntime
	ImageManager image.Service
	ImageMounter clusterimage.Interface
}

func (*GenerateProcessor) ApplyRegistry

func (g *GenerateProcessor) ApplyRegistry(cluster *v2.Cluster) error

func (*GenerateProcessor) GetPipeLine

func (g *GenerateProcessor) GetPipeLine() ([]func(cluster *v2.Cluster) error, error)

func (*GenerateProcessor) MountImage

func (g *GenerateProcessor) MountImage(cluster *v2.Cluster) error

func (*GenerateProcessor) MountRootfs

func (g *GenerateProcessor) MountRootfs(cluster *v2.Cluster) error

func (*GenerateProcessor) UnmountImage

func (g *GenerateProcessor) UnmountImage(cluster *v2.Cluster) error

type InstallProcessor

type InstallProcessor struct {
	Guest   guest.Interface
	Config  config.Interface
	Plugins plugin.Plugins
	// contains filtered or unexported fields
}

func (*InstallProcessor) GetPhasePluginFunc

func (i *InstallProcessor) GetPhasePluginFunc(phase plugin.Phase) func(cluster *v2.Cluster) error

func (*InstallProcessor) GetPipeLine

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

func (*InstallProcessor) Install

func (i *InstallProcessor) Install(cluster *v2.Cluster) error

func (*InstallProcessor) MountRootfs

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

func (*InstallProcessor) Process

func (i *InstallProcessor) Process(cluster *v2.Cluster) error

func (*InstallProcessor) RunConfig

func (i *InstallProcessor) RunConfig(cluster *v2.Cluster) error

type Interface

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

func NewExecutor

func NewExecutor(proc Processor) Interface

func NewUpgradeProcessor

func NewUpgradeProcessor(rootfs string, rt runtime.Interface) (Interface, error)

type ParserArg

type ParserArg struct {
	Name       string
	Passwd     string
	Image      string
	Port       uint16
	Pk         string
	PkPassword string
}

type Processor

type Processor interface {
	GetPipeLine() ([]func(cluster *v2.Cluster) error, error)
}

func NewCreateProcessor

func NewCreateProcessor(clusterFile clusterfile.Interface) (Processor, error)

func NewDeleteProcessor

func NewDeleteProcessor(clusterFile clusterfile.Interface) (Processor, error)

func NewGenerateProcessor

func NewGenerateProcessor() (Processor, error)

func NewInstallProcessor

func NewInstallProcessor(clusterFile clusterfile.Interface) (Processor, error)

func NewScaleProcessor

func NewScaleProcessor(kubeadmConfig *runtime.KubeadmConfig, clusterFile clusterfile.Interface, masterToJoin, masterToDelete, nodeToJoin, nodeToDelete []net.IP) (Processor, error)

type ScaleProcessor

type ScaleProcessor struct {
	ClusterFile     clusterfile.Interface
	Runtime         runtime.Interface
	KubeadmConfig   *runtime.KubeadmConfig
	Config          config.Interface
	Plugins         plugin.Plugins
	MastersToJoin   []net.IP
	MastersToDelete []net.IP
	NodesToJoin     []net.IP
	NodesToDelete   []net.IP
	IsScaleUp       bool
	// contains filtered or unexported fields
}

func (*ScaleProcessor) Delete

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

func (*ScaleProcessor) GetPhasePluginFunc

func (s *ScaleProcessor) GetPhasePluginFunc(phase plugin.Phase) func(cluster *v2.Cluster) error

func (*ScaleProcessor) GetPipeLine

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

func (*ScaleProcessor) Join

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

func (*ScaleProcessor) MountRootfs

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

func (*ScaleProcessor) PreProcess

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

func (*ScaleProcessor) RunConfig

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

func (*ScaleProcessor) UnMountRootfs

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

type UpgradeProcessor

type UpgradeProcessor struct {
	Runtime runtime.Interface
	// contains filtered or unexported fields
}

func (UpgradeProcessor) Execute

func (u UpgradeProcessor) Execute(cluster *v2.Cluster) error

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

func (UpgradeProcessor) MountRootfs

func (u UpgradeProcessor) MountRootfs(cluster *v2.Cluster) error

func (UpgradeProcessor) Upgrade

func (u UpgradeProcessor) Upgrade() error

Jump to

Keyboard shortcuts

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