fake

package
v1.22.4-rc.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewNodeInfoLister

func NewNodeInfoLister(nodes []*v1.Node) framework.NodeInfoLister

NewNodeInfoLister create a new fake NodeInfoLister from a slice of v1.Nodes.

Types

type CSINodeLister

type CSINodeLister storagev1.CSINode

CSINodeLister declares a storagev1.CSINode type for testing.

func (CSINodeLister) Get

func (n CSINodeLister) Get(name string) (*storagev1.CSINode, error)

Get returns a fake CSINode object.

func (CSINodeLister) List

func (n CSINodeLister) List(selector labels.Selector) (ret []*storagev1.CSINode, err error)

List lists all CSINodes in the indexer.

type ControllerLister

type ControllerLister []*v1.ReplicationController

ControllerLister implements ControllerLister on []v1.ReplicationController for test purposes.

func (ControllerLister) GetPodControllers

func (f ControllerLister) GetPodControllers(pod *v1.Pod) (controllers []*v1.ReplicationController, err error)

GetPodControllers gets the ReplicationControllers that have the selector that match the labels on the given pod

func (ControllerLister) List

List returns []v1.ReplicationController, the list of all ReplicationControllers.

func (ControllerLister) ReplicationControllers

func (f ControllerLister) ReplicationControllers(namespace string) corelisters.ReplicationControllerNamespaceLister

ReplicationControllers returns nil

type NodeInfoLister

type NodeInfoLister []*framework.NodeInfo

NodeInfoLister declares a framework.NodeInfo type for testing.

func (NodeInfoLister) Get

func (nodes NodeInfoLister) Get(nodeName string) (*framework.NodeInfo, error)

Get returns a fake node object in the fake nodes.

func (NodeInfoLister) HavePodsWithAffinityList

func (nodes NodeInfoLister) HavePodsWithAffinityList() ([]*framework.NodeInfo, error)

HavePodsWithAffinityList is supposed to list nodes with at least one pod with affinity. For the fake lister we just return everything.

func (NodeInfoLister) HavePodsWithRequiredAntiAffinityList

func (nodes NodeInfoLister) HavePodsWithRequiredAntiAffinityList() ([]*framework.NodeInfo, error)

HavePodsWithRequiredAntiAffinityList is supposed to list nodes with at least one pod with required anti-affinity. For the fake lister we just return everything.

func (NodeInfoLister) List

func (nodes NodeInfoLister) List() ([]*framework.NodeInfo, error)

List lists all nodes.

type PersistentVolumeClaimLister

type PersistentVolumeClaimLister []v1.PersistentVolumeClaim

PersistentVolumeClaimLister declares a []v1.PersistentVolumeClaim type for testing.

func (PersistentVolumeClaimLister) List

func (pvcs PersistentVolumeClaimLister) List(selector labels.Selector) (ret []*v1.PersistentVolumeClaim, err error)

List gets PVC matching the namespace and PVC ID.

func (PersistentVolumeClaimLister) PersistentVolumeClaims

PersistentVolumeClaims returns a fake PersistentVolumeClaimLister object.

type PersistentVolumeLister

type PersistentVolumeLister []v1.PersistentVolume

PersistentVolumeLister declares a []v1.PersistentVolume type for testing.

func (PersistentVolumeLister) Get

Get returns a fake PV object in the fake PVs by PV ID.

func (PersistentVolumeLister) List

List lists all PersistentVolumes in the indexer.

type ReplicaSetLister

type ReplicaSetLister []*appsv1.ReplicaSet

ReplicaSetLister implements ControllerLister on []extensions.ReplicaSet for test purposes.

func (ReplicaSetLister) GetPodReplicaSets

func (f ReplicaSetLister) GetPodReplicaSets(pod *v1.Pod) (rss []*appsv1.ReplicaSet, err error)

GetPodReplicaSets gets the ReplicaSets that have the selector that match the labels on the given pod

func (ReplicaSetLister) List

List returns replica sets.

func (ReplicaSetLister) ReplicaSets

ReplicaSets returns nil

type ServiceLister

type ServiceLister []*v1.Service

ServiceLister implements ServiceLister on []v1.Service for test purposes.

func (ServiceLister) List

func (f ServiceLister) List(labels.Selector) ([]*v1.Service, error)

List returns v1.ServiceList, the list of all services.

func (ServiceLister) Services

Services returns nil.

type StatefulSetLister

type StatefulSetLister []*appsv1.StatefulSet

StatefulSetLister implements ControllerLister on []appsv1.StatefulSet for testing purposes.

func (StatefulSetLister) GetPodStatefulSets

func (f StatefulSetLister) GetPodStatefulSets(pod *v1.Pod) (sss []*appsv1.StatefulSet, err error)

GetPodStatefulSets gets the StatefulSets that have the selector that match the labels on the given pod.

func (StatefulSetLister) List

List returns stateful sets.

func (StatefulSetLister) StatefulSets

StatefulSets returns nil

type StorageClassLister

type StorageClassLister []storagev1.StorageClass

StorageClassLister declares a []storagev1.StorageClass type for testing.

func (StorageClassLister) Get

func (classes StorageClassLister) Get(name string) (*storagev1.StorageClass, error)

Get returns a fake storage class object in the fake storage classes by name.

func (StorageClassLister) List

func (classes StorageClassLister) List(selector labels.Selector) ([]*storagev1.StorageClass, error)

List lists all StorageClass in the indexer.

Jump to

Keyboard shortcuts

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