plugin

package
v0.8.5 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2022 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PhasePreInit     = Phase("PreInit")
	PhasePreJoin     = Phase("PreJoin")
	PhasePostJoin    = Phase("PostJoin")
	PhasePreInstall  = Phase("PreInstall")
	PhasePostInstall = Phase("PostInstall")
	PhaseOriginally  = Phase("Originally")
	PhasePreGuest    = Phase("PreGuest")
	PhasePreClean    = Phase("PreClean")
	PhasePostClean   = Phase("PostClean")
)
View Source
const (
	// Plugin used for golang so file to find the related symbol
	Plugin             = "Plugin"
	PluginType         = "PluginType"
	EtcdPlugin         = "ETCD"
	LabelPlugin        = "LABEL"
	ShellPlugin        = "SHELL"
	TaintPlugin        = "TAINT"
	HostNamePlugin     = "HOSTNAME"
	ClusterCheckPlugin = "CLUSTERCHECK"
)
View Source
const (
	ClusterNotReady = "ClusterNotReady"
	ClusterReady    = "ClusterReady"
)
View Source
const (
	DelSymbol   = "-"
	EqualSymbol = "="
	ColonSymbol = ":"
	SplitSymbol = "|"
)

Variables

Functions

func GetIpsByOnField added in v0.7.1

func GetIpsByOnField(on string, context Context, phase Phase) (ipList []string, err error)

func NotInEffect added in v0.7.1

func NotInEffect(effect v1.TaintEffect, effects []v1.TaintEffect) bool

func Register

func Register(name string, factory Interface)

Types

type ClusterChecker

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

func (*ClusterChecker) Run

func (c *ClusterChecker) Run(context Context, phase Phase) error

type Context

type Context struct {
	Plugin  *v1.Plugin
	Cluster *v2.Cluster
	Host    []string
}

type EtcdBackupPlugin

type EtcdBackupPlugin struct {
}

func (EtcdBackupPlugin) Run

func (e EtcdBackupPlugin) Run(context Context, phase Phase) error

type HostnamePlugin

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

func (HostnamePlugin) Run

func (h HostnamePlugin) Run(context Context, phase Phase) error

type Interface

type Interface interface {
	Run(context Context, phase Phase) error
}

func NewClusterCheckerPlugin

func NewClusterCheckerPlugin() Interface

func NewEtcdBackupPlugin

func NewEtcdBackupPlugin() Interface

func NewHostnamePlugin

func NewHostnamePlugin() Interface

func NewLabelsPlugin

func NewLabelsPlugin() Interface

func NewShellPlugin

func NewShellPlugin() Interface

func NewTaintPlugin added in v0.7.1

func NewTaintPlugin() Interface

type InvalidPluginTypeError

type InvalidPluginTypeError struct {
	Name string
}

func (InvalidPluginTypeError) Error

func (err InvalidPluginTypeError) Error() string

type LabelsNodes

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

func (LabelsNodes) Run

func (l LabelsNodes) Run(context Context, phase Phase) error

type Phase

type Phase string

type Plugins

type Plugins interface {
	Load() error
	Run(host []string, phase Phase) error
}

func NewPlugins

func NewPlugins(cluster *v2.Cluster, plugins []v1.Plugin) Plugins

plugins form Clusterfile

type PluginsProcessor

type PluginsProcessor struct {
	// plugin config list
	Plugins []v1.Plugin
	Cluster *v2.Cluster
}

PluginsProcessor : process two list: plugin config list and embed pluginFactories that contains plugin interface.

func (*PluginsProcessor) Load

func (c *PluginsProcessor) Load() error

Load plugin configs and shared object(.so) file from $mountRootfs/plugins dir.

func (*PluginsProcessor) Run

func (c *PluginsProcessor) Run(host []string, phase Phase) error

Run execute each in-tree or out-of-tree plugin by traversing the plugin list.

type Sheller

type Sheller struct{}

func (Sheller) Run

func (s Sheller) Run(context Context, phase Phase) (err error)

type Taint added in v0.7.1

type Taint struct {
	IPList []string
	TaintList
}

func (*Taint) Run added in v0.7.1

func (l *Taint) Run(context Context, phase Phase) (err error)

func (*Taint) UpdateTaints added in v0.7.1

func (l *Taint) UpdateTaints(taints []v1.Taint, ip string) []v1.Taint

UpdateTaints return nil mean's needn't update taint

type TaintList added in v0.7.1

type TaintList map[string]*taintList //map[ip]taint

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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