testing

package
v1.13.9 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeControllerLister

type FakeControllerLister []*v1.ReplicationController

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

func (FakeControllerLister) GetPodControllers

func (f FakeControllerLister) 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 (FakeControllerLister) List

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

type FakeNodeLister

type FakeNodeLister []*v1.Node

FakeNodeLister implements NodeLister on a []string for test purposes.

func (FakeNodeLister) List

func (f FakeNodeLister) List() ([]*v1.Node, error)

List returns nodes as a []string.

type FakePDBLister added in v1.13.3

type FakePDBLister []*policy.PodDisruptionBudget

FakePDBLister implements PDBLister on a slice of PodDisruptionBudgets for test purposes.

func (FakePDBLister) List added in v1.13.3

List returns a list of PodDisruptionBudgets.

type FakePersistentVolumeClaimLister

type FakePersistentVolumeClaimLister []*v1.PersistentVolumeClaim

FakePersistentVolumeClaimLister implements PersistentVolumeClaimLister on []*v1.PersistentVolumeClaim for test purposes.

func (FakePersistentVolumeClaimLister) List

List returns not implemented error.

func (FakePersistentVolumeClaimLister) PersistentVolumeClaims

PersistentVolumeClaims returns a FakePersistentVolumeClaimLister object.

type FakePodLister

type FakePodLister []*v1.Pod

FakePodLister implements PodLister on an []v1.Pods for test purposes.

func (FakePodLister) FilteredList

func (f FakePodLister) FilteredList(podFilter algorithm.PodFilter, s labels.Selector) (selected []*v1.Pod, err error)

FilteredList returns pods matching a pod filter and a label selector.

func (FakePodLister) List

func (f FakePodLister) List(s labels.Selector) (selected []*v1.Pod, err error)

List returns []*v1.Pod matching a query.

type FakeReplicaSetLister

type FakeReplicaSetLister []*apps.ReplicaSet

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

func (FakeReplicaSetLister) GetPodReplicaSets

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

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

type FakeServiceLister

type FakeServiceLister []*v1.Service

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

func (FakeServiceLister) GetPodServices

func (f FakeServiceLister) GetPodServices(pod *v1.Pod) (services []*v1.Service, err error)

GetPodServices gets the services that have the selector that match the labels on the given pod.

func (FakeServiceLister) List

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

type FakeStatefulSetLister

type FakeStatefulSetLister []*apps.StatefulSet

FakeStatefulSetLister implements ControllerLister on []apps.StatefulSet for testing purposes.

func (FakeStatefulSetLister) GetPodStatefulSets

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

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

type TestGroup added in v1.11.6

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

TestGroup defines a api group for testing.

var (
	// Groups defines a TestGroup map.
	Groups = make(map[string]TestGroup)
	// Test defines a TestGroup object.
	Test TestGroup
)

func (TestGroup) Codec added in v1.11.6

func (g TestGroup) Codec() runtime.Codec

Codec returns the codec for the API version to test against, as set by the KUBE_TEST_API_TYPE env var.

func (TestGroup) ResourcePath added in v1.11.6

func (g TestGroup) ResourcePath(resource, namespace, name string) string

ResourcePath returns the appropriate path for the given resource, namespace and name. For example, this is of the form: /api/v1/namespaces/foo/pods/pod0 for v1.

func (TestGroup) ResourcePathWithPrefix added in v1.11.6

func (g TestGroup) ResourcePathWithPrefix(prefix, resource, namespace, name string) string

ResourcePathWithPrefix returns the appropriate path for the given prefix (watch, proxy, redirect, etc), resource, namespace and name. For ex, this is of the form: /api/v1/watch/namespaces/foo/pods/pod0 for v1.

func (g TestGroup) SelfLink(resource, name string) string

SelfLink returns a self link that will appear to be for the version Version(). 'resource' should be the resource path, e.g. "pods" for the Pod type. 'name' should be empty for lists.

func (TestGroup) SubResourcePath added in v1.11.6

func (g TestGroup) SubResourcePath(resource, namespace, name, sub string) string

SubResourcePath returns the appropriate path for the given resource, namespace, name and subresource.

Jump to

Keyboard shortcuts

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