unneeded

package
v0.0.0-...-fd14076 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 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 Nodes

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

Nodes tracks the state of cluster nodes that are not needed.

func NewNodes

func NewNodes(sdtg scaleDownTimeGetter, limitsFinder *resource.LimitsFinder) *Nodes

NewNodes returns a new initialized Nodes object.

func (*Nodes) AsList

func (n *Nodes) AsList() []*apiv1.Node

AsList returns a slice of unneeded Node objects.

func (*Nodes) Clear

func (n *Nodes) Clear()

Clear resets the internal state, dropping information about all tracked nodes.

func (*Nodes) Contains

func (n *Nodes) Contains(nodeName string) bool

Contains returns true iff a given node is unneeded.

func (*Nodes) Drop

func (n *Nodes) Drop(node string)

Drop stops tracking a specified node.

func (*Nodes) RemovableAt

func (n *Nodes) RemovableAt(context *context.AutoscalingContext, scaleDownContext nodes.ScaleDownContext, ts time.Time) (empty, needDrain []simulator.NodeToBeRemoved, unremovable []simulator.UnremovableNode)

RemovableAt returns all nodes that can be removed at a given time, divided into empty and non-empty node lists, as well as a list of nodes that were unneeded, but are not removable, annotated by reason.

func (*Nodes) Update

func (n *Nodes) Update(nodes []simulator.NodeToBeRemoved, ts time.Time)

Update stores nodes along with a time at which they were found to be unneeded. Previously existing timestamps are preserved.

Jump to

Keyboard shortcuts

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