nodes

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2021 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("not found")

ErrNotFound is returned when entry hasn't been found on the cache.

Functions

func Add

func Add(mgr manager.Manager, ns string) error

Add creates a new Nodes Controller and adds it to the Manager. The Manager will set fields on the Controller and Start it when the Manager is Started.

Types

type Cache

type Cache struct {
	Obj    *corev1.ConfigMap
	Create bool
	// contains filtered or unexported fields
}

Cache manages information about Nodes.

func (*Cache) Changed

func (c *Cache) Changed() bool

Changed returns true if changes have been made to the cache instance.

func (*Cache) Delete

func (c *Cache) Delete(node string)

Delete removes the node from the cache.

func (*Cache) Get

func (c *Cache) Get(node string) (CacheEntry, error)

Get returns the information about node, or error if not found or failed to unmarshall the data.

func (*Cache) Keys

func (c *Cache) Keys() []string

Keys returns a list of node names on the cache.

func (*Cache) Set

func (c *Cache) Set(node string, entry CacheEntry) error

Set updates the information about node, or error if failed to marshall the data.

type CacheEntry

type CacheEntry struct {
	Instance                 string    `json:"instance"`
	IPAddress                string    `json:"ip"`
	LastSeen                 time.Time `json:"seen"`
	LastMarkedForTermination time.Time `json:"marked"`
}

CacheEntry constains information about a Node.

type ReconcileNodes

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

func (*ReconcileNodes) Start

func (r *ReconcileNodes) Start(stop context.Context) error

Start starts the Nodes Reconciler, and will block until a stop signal is sent.

Jump to

Keyboard shortcuts

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