nodes

package
v1.4.0 Latest Latest
Warning

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

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

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

func (cache *Cache) UpdateTimestamp()

type CacheEntry

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

CacheEntry contains information about a Node.

type CachedNodeInfo

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

type Controller

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

func NewController

func NewController(mgr manager.Manager) *Controller

func (*Controller) Reconcile

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

func (*Controller) SetupWithManager

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