plugin

package
v0.30.2 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

New builds plugin from its arguments while passing a handle

func NewFakeBalance

func NewFakeBalance(args runtime.Object, handle frameworktypes.Handle) (frameworktypes.Plugin, error)

New builds plugin from its arguments while passing a handle

func NewFakeBalancePluginFncFromFake

func NewFakeBalancePluginFncFromFake(fp *FakeBalancePlugin) pluginregistry.PluginBuilder

func NewFakeDeschedule

func NewFakeDeschedule(args runtime.Object, handle frameworktypes.Handle) (frameworktypes.Plugin, error)

New builds plugin from its arguments while passing a handle

func NewFakeDeschedulePluginFncFromFake

func NewFakeDeschedulePluginFncFromFake(fp *FakeDeschedulePlugin) pluginregistry.PluginBuilder

func NewFakeFilter

func NewFakeFilter(args runtime.Object, handle frameworktypes.Handle) (frameworktypes.Plugin, error)

New builds plugin from its arguments while passing a handle

func NewFakeFilterPluginFncFromFake

func NewFakeFilterPluginFncFromFake(fp *FakeFilterPlugin) pluginregistry.PluginBuilder

func NewPluginFncFromFake

func NewPluginFncFromFake(fp *FakePlugin) pluginregistry.PluginBuilder

func SetDefaults_FakePluginArgs

func SetDefaults_FakePluginArgs(obj runtime.Object)

func ValidateFakePluginArgs

func ValidateFakePluginArgs(obj runtime.Object) error

Types

type Action

type Action interface {
	Handle() frameworktypes.Handle
	GetExtensionPoint() string
	DeepCopy() Action
}

type ActionImpl

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

func (ActionImpl) DeepCopy

func (a ActionImpl) DeepCopy() Action

func (ActionImpl) GetExtensionPoint

func (a ActionImpl) GetExtensionPoint() string

func (ActionImpl) Handle

func (a ActionImpl) Handle() frameworktypes.Handle

type BalanceAction

type BalanceAction interface {
	Action
	CanBalance() bool
	Nodes() []*v1.Node
}

type BalanceActionImpl

type BalanceActionImpl struct {
	ActionImpl
	// contains filtered or unexported fields
}

func (BalanceActionImpl) CanBalance

func (d BalanceActionImpl) CanBalance() bool

func (BalanceActionImpl) DeepCopy

func (a BalanceActionImpl) DeepCopy() Action

func (BalanceActionImpl) Nodes

func (d BalanceActionImpl) Nodes() []*v1.Node

type DescheduleAction

type DescheduleAction interface {
	Action
	CanDeschedule() bool
	Nodes() []*v1.Node
}

type DescheduleActionImpl

type DescheduleActionImpl struct {
	ActionImpl
	// contains filtered or unexported fields
}

func (DescheduleActionImpl) CanDeschedule

func (d DescheduleActionImpl) CanDeschedule() bool

func (DescheduleActionImpl) DeepCopy

func (a DescheduleActionImpl) DeepCopy() Action

func (DescheduleActionImpl) Nodes

func (d DescheduleActionImpl) Nodes() []*v1.Node

type FakeBalancePlugin

type FakeBalancePlugin struct {
	PluginName string

	// ReactionChain is the list of reactors that will be attempted for every
	// request in the order they are tried.
	ReactionChain []Reactor
	// contains filtered or unexported fields
}

FakeBalancePlugin is a configurable plugin used for testing

func (*FakeBalancePlugin) AddReactor

func (c *FakeBalancePlugin) AddReactor(extensionPoint string, reaction ReactionFunc)

func (*FakeBalancePlugin) Balance

func (d *FakeBalancePlugin) Balance(ctx context.Context, nodes []*v1.Node) *frameworktypes.Status

func (*FakeBalancePlugin) Name

func (d *FakeBalancePlugin) Name() string

Name retrieves the plugin name

type FakeBalancePluginArgs

type FakeBalancePluginArgs struct {
	metav1.TypeMeta `json:",inline"`
}

FakeBalancePluginArgs holds arguments used to configure FakeBalancePlugin plugin.

func (*FakeBalancePluginArgs) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FakeBalancePluginArgs.

func (*FakeBalancePluginArgs) DeepCopyInto

func (in *FakeBalancePluginArgs) DeepCopyInto(out *FakeBalancePluginArgs)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*FakeBalancePluginArgs) DeepCopyObject

func (in *FakeBalancePluginArgs) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type FakeDeschedulePlugin

type FakeDeschedulePlugin struct {
	PluginName string

	// ReactionChain is the list of reactors that will be attempted for every
	// request in the order they are tried.
	ReactionChain []Reactor
	// contains filtered or unexported fields
}

FakeDeschedulePlugin is a configurable plugin used for testing

func (*FakeDeschedulePlugin) AddReactor

func (c *FakeDeschedulePlugin) AddReactor(extensionPoint string, reaction ReactionFunc)

func (*FakeDeschedulePlugin) Deschedule

func (d *FakeDeschedulePlugin) Deschedule(ctx context.Context, nodes []*v1.Node) *frameworktypes.Status

func (*FakeDeschedulePlugin) Name

func (d *FakeDeschedulePlugin) Name() string

Name retrieves the plugin name

type FakeDeschedulePluginArgs

type FakeDeschedulePluginArgs struct {
	metav1.TypeMeta `json:",inline"`
}

FakeDeschedulePluginArgs holds arguments used to configure FakeDeschedulePlugin plugin.

func (*FakeDeschedulePluginArgs) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FakeDeschedulePluginArgs.

func (*FakeDeschedulePluginArgs) DeepCopyInto

func (in *FakeDeschedulePluginArgs) DeepCopyInto(out *FakeDeschedulePluginArgs)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*FakeDeschedulePluginArgs) DeepCopyObject

func (in *FakeDeschedulePluginArgs) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type FakeFilterPlugin

type FakeFilterPlugin struct {
	PluginName string

	// ReactionChain is the list of reactors that will be attempted for every
	// request in the order they are tried.
	ReactionChain []Reactor
	// contains filtered or unexported fields
}

FakeFilterPlugin is a configurable plugin used for testing

func (*FakeFilterPlugin) AddReactor

func (c *FakeFilterPlugin) AddReactor(extensionPoint string, reaction ReactionFunc)

func (*FakeFilterPlugin) Filter

func (d *FakeFilterPlugin) Filter(pod *v1.Pod) bool

func (*FakeFilterPlugin) Name

func (d *FakeFilterPlugin) Name() string

Name retrieves the plugin name

func (*FakeFilterPlugin) PreEvictionFilter

func (d *FakeFilterPlugin) PreEvictionFilter(pod *v1.Pod) bool

type FakeFilterPluginArgs

type FakeFilterPluginArgs struct {
	metav1.TypeMeta `json:",inline"`
}

FakeFilterPluginArgs holds arguments used to configure FakeFilterPlugin plugin.

func (*FakeFilterPluginArgs) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FakeFilterPluginArgs.

func (*FakeFilterPluginArgs) DeepCopyInto

func (in *FakeFilterPluginArgs) DeepCopyInto(out *FakeFilterPluginArgs)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*FakeFilterPluginArgs) DeepCopyObject

func (in *FakeFilterPluginArgs) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type FakePlugin

type FakePlugin struct {
	PluginName string

	// ReactionChain is the list of reactors that will be attempted for every
	// request in the order they are tried.
	ReactionChain []Reactor
	// contains filtered or unexported fields
}

FakePlugin is a configurable plugin used for testing

func (*FakePlugin) AddReactor

func (c *FakePlugin) AddReactor(extensionPoint string, reaction ReactionFunc)

func (*FakePlugin) Balance

func (d *FakePlugin) Balance(ctx context.Context, nodes []*v1.Node) *frameworktypes.Status

func (*FakePlugin) Deschedule

func (d *FakePlugin) Deschedule(ctx context.Context, nodes []*v1.Node) *frameworktypes.Status

func (*FakePlugin) Filter

func (d *FakePlugin) Filter(pod *v1.Pod) bool

func (*FakePlugin) Name

func (d *FakePlugin) Name() string

Name retrieves the plugin name

func (*FakePlugin) PreEvictionFilter

func (d *FakePlugin) PreEvictionFilter(pod *v1.Pod) bool

type FakePluginArgs

type FakePluginArgs struct {
	metav1.TypeMeta `json:",inline"`
}

FakePluginArgs holds arguments used to configure FakePlugin plugin.

func (*FakePluginArgs) DeepCopy

func (in *FakePluginArgs) DeepCopy() *FakePluginArgs

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FakePluginArgs.

func (*FakePluginArgs) DeepCopyInto

func (in *FakePluginArgs) DeepCopyInto(out *FakePluginArgs)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*FakePluginArgs) DeepCopyObject

func (in *FakePluginArgs) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type FilterAction

type FilterAction interface {
	Action
	CanFilter() bool
}

type FilterActionImpl

type FilterActionImpl struct {
	ActionImpl
}

func (FilterActionImpl) CanFilter

func (d FilterActionImpl) CanFilter() bool

func (FilterActionImpl) DeepCopy

func (a FilterActionImpl) DeepCopy() Action

type PreEvictionFilterAction

type PreEvictionFilterAction interface {
	Action
	CanPreEvictionFilter() bool
}

type PreEvictionFilterActionImpl

type PreEvictionFilterActionImpl struct {
	ActionImpl
}

func (PreEvictionFilterActionImpl) CanPreEvictionFilter

func (d PreEvictionFilterActionImpl) CanPreEvictionFilter() bool

func (PreEvictionFilterActionImpl) DeepCopy

func (a PreEvictionFilterActionImpl) DeepCopy() Action

type ReactionFunc

type ReactionFunc func(action Action) (handled, filter bool, err error)

type Reactor

type Reactor interface {
	// Handles indicates whether or not this Reactor deals with a given
	// action.
	Handles(action Action) bool
	// React handles the action.  It may choose to
	// delegate by indicated handled=false.
	// filter is used to store results of filter based actions
	React(action Action) (handled, filter bool, err error)
}

Reactor is an interface to allow the composition of reaction functions.

type SimpleReactor

type SimpleReactor struct {
	ExtensionPoint string
	Reaction       ReactionFunc
}

SimpleReactor is a Reactor. Each reaction function is attached to a given extensionPoint. "*" in either field matches everything for that value.

func (*SimpleReactor) Handles

func (r *SimpleReactor) Handles(action Action) bool

func (*SimpleReactor) React

func (r *SimpleReactor) React(action Action) (bool, bool, error)

Jump to

Keyboard shortcuts

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