lister

package
v0.0.0-...-bea9c9c Latest Latest
Warning

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

Go to latest
Published: May 12, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrCacheSyncFailed is returned by a lister when we fail to synchronize its internal cache.
	ErrCacheSyncFailed = errors.New("cache sync failed")
)

Functions

func NewKubernetesNodeLister

func NewKubernetesNodeLister(client kubernetes.Interface) *kubernetesNodeLister

NewKubernetesNodeLister returns a NodeLister that provides simplified listing of nodes via the underlying client-go SharedInformer APIs

func NewKubernetesPodLister

func NewKubernetesPodLister(client kubernetes.Interface) *kubernetesPodLister

NewKubernetesPodLister returns a PodLister that provides simplified listing of pods via the underlying client-go SharedInformer APIs.

Types

type FakeNodeLister

type FakeNodeLister struct {
	Nodes []*core_v1.Node
}

FakeNodeLister provides a mock NodeLister implementation.

func (*FakeNodeLister) List

func (l *FakeNodeLister) List(selector labels.Selector) ([]*core_v1.Node, error)

List returns the slice of nodes provided to this NodeLister.

func (*FakeNodeLister) Run

func (l *FakeNodeLister) Run(stopCh <-chan struct{}) error

Run mimics the run loop of a concrete NodeLister.

type FakePodLister

type FakePodLister struct {
	Pods []*core_v1.Pod
}

FakePodLister provides a mock PodLister implementation.

func (*FakePodLister) List

func (l *FakePodLister) List(selector labels.Selector) ([]*core_v1.Pod, error)

List returns the list of pods provided to the FakePodLister.

func (*FakePodLister) Run

func (l *FakePodLister) Run(stopCh <-chan struct{}) error

Run mimics the run loop of a concrete PodLister.

type NodeLister

type NodeLister interface {
	List(selector labels.Selector) (ret []*core_v1.Node, err error)
	Run(stopCh <-chan struct{}) error
}

NodeLister lists nodes in a kubernetes cluster. The canonical implementation uses the kubernetes informer mechanism, which is expected to be started via a call to the Run method. Prior to this, a concrete implementation will generally not succesfully return nodes.

type PodLister

type PodLister interface {
	List(selector labels.Selector) ([]*core_v1.Pod, error)
	Run(stopCh <-chan struct{}) error
}

PodLister lists pods in a kubernetes cluster. The canonical implementation uses the kubernetes informer mechanism, which is expected to be started via a call to the Run method. Prior to this, a concrete implementation will generally not succesfully return pods.

Jump to

Keyboard shortcuts

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