utils

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2025 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LabelPrefix    = "nodedrain.k8s.slyng.dk"
	LabelComponent = LabelPrefix + "/component"
)

Variables

This section is empty.

Functions

func GetFieldOwner

func GetFieldOwner(managerNamespace string) string

func PtrTo

func PtrTo[T any](v T) *T

func Wrap

func Wrap(z *zap.Logger) hclog.Logger

Types

type DrainManager

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

func NewDrainManager

func NewDrainManager(ctx context.Context, client kClient.Client, restConfig *rest.Config) (*DrainManager, error)

func (*DrainManager) IsClusterNodesHealthy

func (d *DrainManager) IsClusterNodesHealthy(ctx context.Context) (bool, error)

func (*DrainManager) IsDrainOk

func (d *DrainManager) IsDrainOk(ctx context.Context, nodeName string) (bool, error)

func (*DrainManager) IsHealthy

func (d *DrainManager) IsHealthy(ctx context.Context) (bool, error)

func (*DrainManager) RunPostDrain

func (d *DrainManager) RunPostDrain(ctx context.Context, nodeName string) error

func (*DrainManager) RunPreDrain

func (d *DrainManager) RunPreDrain(ctx context.Context, nodeName string) error

type Level

type Level = hclog.Level

type RebootManager

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

func NewRebootManager

func NewRebootManager(l *zap.Logger, client client.Client, restConfig *rest.Config, namespace string) (*RebootManager, error)

func (*RebootManager) Cleanup

func (r *RebootManager) Cleanup(ctx context.Context) error

func (*RebootManager) CleanupNode

func (r *RebootManager) CleanupNode(ctx context.Context, nodeName string) error

func (*RebootManager) IsNodeRebooted

func (r *RebootManager) IsNodeRebooted(ctx context.Context, kubeNode *corev1.Node, oldBootId string) (bool, error)

func (*RebootManager) IsRebootRequired

func (r *RebootManager) IsRebootRequired(ctx context.Context, nodeName string) (bool, error)

func (*RebootManager) RebootNode

func (r *RebootManager) RebootNode(ctx context.Context, nodeName string) error

Jump to

Keyboard shortcuts

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