nodes

package
v0.14.2 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2023 License: Apache-2.0 Imports: 23 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, _ string) error

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 (cache *Cache) Changed() bool

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

func (*Cache) ContainsKey added in v0.5.0

func (cache *Cache) ContainsKey(key string) bool

func (*Cache) Delete

func (cache *Cache) Delete(node string)

Delete removes the node from the cache.

func (*Cache) Get

func (cache *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) IsCacheOutdated added in v0.5.0

func (cache *Cache) IsCacheOutdated() bool

func (*Cache) Keys

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

Keys returns a list of node names on the cache.

func (*Cache) Set

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

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

func (*Cache) UpdateTimestamp added in v0.5.0

func (cache *Cache) UpdateTimestamp()

type CacheEntry

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

CacheEntry contains information about a Node.

type CachedNodeInfo added in v0.5.0

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

type Controller added in v0.11.0

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

func NewController added in v0.5.0

func NewController(mgr manager.Manager) *Controller

func (*Controller) Reconcile added in v0.11.0

func (controller *Controller) Reconcile(ctx context.Context, request reconcile.Request) (reconcile.Result, error)

func (*Controller) SetupWithManager added in v0.11.0

func (controller *Controller) SetupWithManager(mgr ctrl.Manager) error

Jump to

Keyboard shortcuts

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