drainhelper

package
v0.0.0-...-1803088 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DrainHelper

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

func NewDrainHelper

func NewDrainHelper(log *logrus.Logger, cs *clientset.Clientset, nodeName, namespace string) *DrainHelper

func (*DrainHelper) Run

func (dh *DrainHelper) Run(f func(context.Context) bool, drain bool) error

Run joins leader election and drains(only if drain is set) the node if becomes a leader.

f is a function that takes a context and returns a bool. It should return true if uncordon should be performed(Only applicable if drain is set to true). If `f` returns false, the uncordon does not take place. This is useful in 2-step scenario like sriov-fec-daemon where reboot must be performed without loosing the leadership and without the uncordon.

Jump to

Keyboard shortcuts

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