Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { GetNodeInfo(nodeName string) (*NodeInfo, error) GetServerVersion() (*version.Info, error) }
Client an interface for querying the k8s API server
func NewClient ¶
func NewClient(client client.Kubernetes) Client
NewClient creates a new API Server client
func NewFileCacheClientWrapper ¶
func NewFileCacheClientWrapper(client Client, config client.DiscoveryCacherConfig, options ...Option) Client
NewFileCacheClientWrapper wraps the given Client and caches the responses for the given TTL.
type NodeInfo ¶
type NodeInfo struct { NodeName string Labels map[string]string Allocatable v1.ResourceList Capacity v1.ResourceList Conditions []v1.NodeCondition Unschedulable bool KubeletVersion string }
NodeInfo contains information about a specific node
func (*NodeInfo) IsMasterNode ¶
IsMasterNode returns true if the NodeInfo contains the labels that identify a node as master.
type Option ¶
type Option func(*fileCacheClient)
Option is a func that configures the fileCacheClient
func WithTimeProvider ¶
func WithTimeProvider(timeProvider TimeProvider) Option
WithTimeProvider overrides the default TimeProvider (which returns the current time). This is useful for testing cache durations/evictions
type TestAPIServer ¶
TestAPIServer is for testing purposes. It implements the apiserver.Client interface with an in-memory list of objects
func (TestAPIServer) GetNodeInfo ¶
func (t TestAPIServer) GetNodeInfo(nodeName string) (*NodeInfo, error)
func (TestAPIServer) GetServerVersion ¶
func (t TestAPIServer) GetServerVersion() (*version.Info, error)
type TimeProvider ¶
TimeProvider defines an interface that returns the current time. It's used for testing.