Documentation ¶
Index ¶
- type Store
- func (s *Store) AddInterruptionEvent(interruptionEvent *monitor.InterruptionEvent)
- func (s *Store) CancelInterruptionEvent(eventID string)
- func (s *Store) GetActiveEvent() (*monitor.InterruptionEvent, bool)
- func (s *Store) IgnoreEvent(eventID string)
- func (s *Store) MarkAllAsProcessed(nodeName string)
- func (s *Store) ShouldDrainNode() bool
- func (s *Store) ShouldUncordonNode(nodeName string) bool
- func (s *Store) TimeUntilDrain(interruptionEvent *monitor.InterruptionEvent) time.Duration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct { sync.RWMutex NthConfig config.Config Workers chan int // contains filtered or unexported fields }
Store is the drain event store data structure
func (*Store) AddInterruptionEvent ¶
func (s *Store) AddInterruptionEvent(interruptionEvent *monitor.InterruptionEvent)
AddInterruptionEvent adds an interruption event to the internal store
func (*Store) CancelInterruptionEvent ¶
CancelInterruptionEvent removes an interruption event from the internal store
func (*Store) GetActiveEvent ¶
func (s *Store) GetActiveEvent() (*monitor.InterruptionEvent, bool)
GetActiveEvent returns true if there are interruption events in the internal store
func (*Store) IgnoreEvent ¶
IgnoreEvent will store an event ID so that monitor loops cannot write to the store with the same event ID Drain actions are ignored on the passed in event ID by setting the NodeProcessed flag to true
func (*Store) MarkAllAsProcessed ¶ added in v1.13.1
MarkAllAsProcessed should be called after the node has been drained to prevent further unnecessary drain calls to the k8s api
func (*Store) ShouldDrainNode ¶
ShouldDrainNode returns true if there are drainable events in the internal store
func (*Store) ShouldUncordonNode ¶
ShouldUncordonNode returns true if there was a interruption event but it was canceled and the store is now empty or only consists of ignored events
func (*Store) TimeUntilDrain ¶
func (s *Store) TimeUntilDrain(interruptionEvent *monitor.InterruptionEvent) time.Duration
TimeUntilDrain returns the duration until a node drain should occur (can return a negative duration)