testclient

package
v1.2.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2015 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddObjectsFromPath

func AddObjectsFromPath(path string, o ObjectRetriever, decoder runtime.Decoder) error

AddObjectsFromPath loads the JSON or YAML file containing Kubernetes API resources and adds them to the provided ObjectRetriever.

Types

type Action

type Action interface {
	GetNamespace() string
	GetVerb() string
	GetResource() string
	GetSubresource() string
	Matches(verb, resource string) bool
}

type ActionImpl

type ActionImpl struct {
	Namespace   string
	Verb        string
	Resource    string
	Subresource string
}

func (ActionImpl) GetNamespace

func (a ActionImpl) GetNamespace() string

func (ActionImpl) GetResource

func (a ActionImpl) GetResource() string

func (ActionImpl) GetSubresource

func (a ActionImpl) GetSubresource() string

func (ActionImpl) GetVerb

func (a ActionImpl) GetVerb() string

func (ActionImpl) Matches

func (a ActionImpl) Matches(verb, resource string) bool

type CreateAction

type CreateAction interface {
	Action
	GetObject() runtime.Object
}

type CreateActionImpl

type CreateActionImpl struct {
	ActionImpl
	Object runtime.Object
}

func NewCreateAction

func NewCreateAction(resource, namespace string, object runtime.Object) CreateActionImpl

func NewRootCreateAction

func NewRootCreateAction(resource string, object runtime.Object) CreateActionImpl

func (CreateActionImpl) GetObject

func (a CreateActionImpl) GetObject() runtime.Object

type DeleteAction

type DeleteAction interface {
	Action
	GetName() string
}

type DeleteActionImpl

type DeleteActionImpl struct {
	ActionImpl
	Name string
}

func NewDeleteAction

func NewDeleteAction(resource, namespace, name string) DeleteActionImpl

func NewRootDeleteAction

func NewRootDeleteAction(resource, name string) DeleteActionImpl

func (DeleteActionImpl) GetName

func (a DeleteActionImpl) GetName() string

type Fake

type Fake struct {
	sync.RWMutex

	// ReactionChain is the list of reactors that will be attempted for every request in the order they are tried
	ReactionChain []Reactor
	// WatchReactionChain is the list of watch reactors that will be attempted for every request in the order they are tried
	WatchReactionChain []WatchReactor
	// ProxyReactionChain is the list of proxy reactors that will be attempted for every request in the order they are tried
	ProxyReactionChain []ProxyReactor

	Resources map[string]*unversioned.APIResourceList
	// contains filtered or unexported fields
}

Fake implements client.Interface. Meant to be embedded into a struct to get a default implementation. This makes faking out just the method you want to test easier.

func NewSimpleFake

func NewSimpleFake(objects ...runtime.Object) *Fake

NewSimpleFake returns a client that will respond with the provided objects

func (*Fake) Actions

func (c *Fake) Actions() []Action

Actions returns a chronologically ordered slice fake actions called on the fake client

func (*Fake) AddProxyReactor

func (c *Fake) AddProxyReactor(resource string, reaction ProxyReactionFunc)

AddProxyReactor appends a reactor to the end of the chain

func (*Fake) AddReactor

func (c *Fake) AddReactor(verb, resource string, reaction ReactionFunc)

AddReactor appends a reactor to the end of the chain

func (*Fake) AddWatchReactor

func (c *Fake) AddWatchReactor(resource string, reaction WatchReactionFunc)

AddWatchReactor appends a reactor to the end of the chain

func (*Fake) ClearActions

func (c *Fake) ClearActions()

ClearActions clears the history of actions called on the fake client

func (*Fake) ComponentStatuses

func (c *Fake) ComponentStatuses() client.ComponentStatusInterface

func (*Fake) Discovery

func (c *Fake) Discovery() client.DiscoveryInterface

func (*Fake) Endpoints

func (c *Fake) Endpoints(namespace string) client.EndpointsInterface

func (*Fake) Events

func (c *Fake) Events(namespace string) client.EventInterface

func (*Fake) Extensions

func (c *Fake) Extensions() client.ExtensionsInterface

func (*Fake) Invokes

func (c *Fake) Invokes(action Action, defaultReturnObj runtime.Object) (runtime.Object, error)

Invokes records the provided Action and then invokes the ReactFn (if provided). defaultReturnObj is expected to be of the same type a normal call would return.

func (*Fake) InvokesProxy

func (c *Fake) InvokesProxy(action Action) client.ResponseWrapper

InvokesProxy records the provided Action and then invokes the ReactFn (if provided).

func (*Fake) InvokesWatch

func (c *Fake) InvokesWatch(action Action) (watch.Interface, error)

InvokesWatch records the provided Action and then invokes the ReactFn (if provided).

func (*Fake) LimitRanges

func (c *Fake) LimitRanges(namespace string) client.LimitRangeInterface

func (*Fake) Namespaces

func (c *Fake) Namespaces() client.NamespaceInterface

func (*Fake) Nodes

func (c *Fake) Nodes() client.NodeInterface

func (*Fake) PersistentVolumeClaims

func (c *Fake) PersistentVolumeClaims(namespace string) client.PersistentVolumeClaimInterface

func (*Fake) PersistentVolumes

func (c *Fake) PersistentVolumes() client.PersistentVolumeInterface

func (*Fake) PodTemplates

func (c *Fake) PodTemplates(namespace string) client.PodTemplateInterface

func (*Fake) Pods

func (c *Fake) Pods(namespace string) client.PodInterface

func (*Fake) PrependProxyReactor

func (c *Fake) PrependProxyReactor(resource string, reaction ProxyReactionFunc)

PrependProxyReactor adds a reactor to the beginning of the chain

func (*Fake) PrependReactor

func (c *Fake) PrependReactor(verb, resource string, reaction ReactionFunc)

PrependReactor adds a reactor to the beginning of the chain

func (*Fake) PrependWatchReactor

func (c *Fake) PrependWatchReactor(resource string, reaction WatchReactionFunc)

PrependWatchReactor adds a reactor to the beginning of the chain

func (*Fake) ReplicationControllers

func (c *Fake) ReplicationControllers(namespace string) client.ReplicationControllerInterface

func (*Fake) ResourceQuotas

func (c *Fake) ResourceQuotas(namespace string) client.ResourceQuotaInterface

func (*Fake) Secrets

func (c *Fake) Secrets(namespace string) client.SecretsInterface

func (*Fake) ServerAPIVersions

func (c *Fake) ServerAPIVersions() (*unversioned.APIVersions, error)

func (*Fake) ServerVersion

func (c *Fake) ServerVersion() (*version.Info, error)

func (*Fake) ServiceAccounts

func (c *Fake) ServiceAccounts(namespace string) client.ServiceAccountsInterface

func (*Fake) Services

func (c *Fake) Services(namespace string) client.ServiceInterface

func (*Fake) SwaggerSchema

func (c *Fake) SwaggerSchema(version string) (*swagger.ApiDeclaration, error)

SwaggerSchema returns an empty swagger.ApiDeclaration for testing

type FakeComponentStatuses

type FakeComponentStatuses struct {
	Fake *Fake
}

Fake implements ComponentStatusInterface.

func (*FakeComponentStatuses) Get

func (*FakeComponentStatuses) List

func (c *FakeComponentStatuses) List(label labels.Selector, field fields.Selector) (result *api.ComponentStatusList, err error)

type FakeDaemonSets

type FakeDaemonSets struct {
	Fake      *FakeExperimental
	Namespace string
}

FakeDaemonSet implements DaemonInterface. Meant to be embedded into a struct to get a default implementation. This makes faking out just the method you want to test easier.

func (*FakeDaemonSets) Create

func (*FakeDaemonSets) Delete

func (c *FakeDaemonSets) Delete(name string) error

func (*FakeDaemonSets) Get

func (c *FakeDaemonSets) Get(name string) (*extensions.DaemonSet, error)

func (*FakeDaemonSets) List

func (*FakeDaemonSets) Update

func (*FakeDaemonSets) UpdateStatus

func (c *FakeDaemonSets) UpdateStatus(daemon *extensions.DaemonSet) (*extensions.DaemonSet, error)

func (*FakeDaemonSets) Watch

func (c *FakeDaemonSets) Watch(label labels.Selector, field fields.Selector, opts api.ListOptions) (watch.Interface, error)

type FakeDeployments

type FakeDeployments struct {
	Fake      *FakeExperimental
	Namespace string
}

FakeDeployments implements DeploymentsInterface. Meant to be embedded into a struct to get a default implementation. This makes faking out just the methods you want to test easier.

func (*FakeDeployments) Create

func (c *FakeDeployments) Create(deployment *extensions.Deployment) (*extensions.Deployment, error)

func (*FakeDeployments) Delete

func (c *FakeDeployments) Delete(name string, options *api.DeleteOptions) error

func (*FakeDeployments) Get

func (*FakeDeployments) List

func (*FakeDeployments) Update

func (c *FakeDeployments) Update(deployment *extensions.Deployment) (*extensions.Deployment, error)

func (*FakeDeployments) UpdateStatus

func (c *FakeDeployments) UpdateStatus(deployment *extensions.Deployment) (*extensions.Deployment, error)

func (*FakeDeployments) Watch

type FakeDiscovery

type FakeDiscovery struct {
	*Fake
}

func (*FakeDiscovery) ServerGroups

func (c *FakeDiscovery) ServerGroups() (*unversioned.APIGroupList, error)

func (*FakeDiscovery) ServerResources

func (c *FakeDiscovery) ServerResources() (map[string]*unversioned.APIResourceList, error)

func (*FakeDiscovery) ServerResourcesForGroupVersion

func (c *FakeDiscovery) ServerResourcesForGroupVersion(groupVersion string) (*unversioned.APIResourceList, error)

type FakeEndpoints

type FakeEndpoints struct {
	Fake      *Fake
	Namespace string
}

FakeEndpoints implements EndpointInterface. Meant to be embedded into a struct to get a default implementation. This makes faking out just the method you want to test easier.

func (*FakeEndpoints) Create

func (c *FakeEndpoints) Create(endpoints *api.Endpoints) (*api.Endpoints, error)

func (*FakeEndpoints) Delete

func (c *FakeEndpoints) Delete(name string) error

func (*FakeEndpoints) Get

func (c *FakeEndpoints) Get(name string) (*api.Endpoints, error)

func (*FakeEndpoints) List

func (c *FakeEndpoints) List(label labels.Selector, field fields.Selector) (*api.EndpointsList, error)

func (*FakeEndpoints) Update

func (c *FakeEndpoints) Update(endpoints *api.Endpoints) (*api.Endpoints, error)

func (*FakeEndpoints) Watch

func (c *FakeEndpoints) Watch(label labels.Selector, field fields.Selector, opts api.ListOptions) (watch.Interface, error)

type FakeEvents

type FakeEvents struct {
	Fake      *Fake
	Namespace string
}

FakeEvents implements EventInterface. Meant to be embedded into a struct to get a default implementation. This makes faking out just the method you want to test easier.

func (*FakeEvents) Create

func (c *FakeEvents) Create(event *api.Event) (*api.Event, error)

Create makes a new event. Returns the copy of the event the server returns, or an error.

func (*FakeEvents) Delete

func (c *FakeEvents) Delete(name string) error

func (*FakeEvents) Get

func (c *FakeEvents) Get(name string) (*api.Event, error)

Get returns the given event, or an error.

func (*FakeEvents) GetFieldSelector

func (c *FakeEvents) GetFieldSelector(involvedObjectName, involvedObjectNamespace, involvedObjectKind, involvedObjectUID *string) fields.Selector

func (*FakeEvents) List

func (c *FakeEvents) List(label labels.Selector, field fields.Selector) (*api.EventList, error)

List returns a list of events matching the selectors.

func (*FakeEvents) Patch

func (c *FakeEvents) Patch(event *api.Event, data []byte) (*api.Event, error)

Patch patches an existing event. Returns the copy of the event the server returns, or an error.

func (*FakeEvents) Search

func (c *FakeEvents) Search(objOrRef runtime.Object) (*api.EventList, error)

Search returns a list of events matching the specified object.

func (*FakeEvents) Update

func (c *FakeEvents) Update(event *api.Event) (*api.Event, error)

Update replaces an existing event. Returns the copy of the event the server returns, or an error.

func (*FakeEvents) Watch

func (c *FakeEvents) Watch(label labels.Selector, field fields.Selector, opts api.ListOptions) (watch.Interface, error)

Watch starts watching for events matching the given selectors.

type FakeExperimental

type FakeExperimental struct {
	*Fake
}

func (*FakeExperimental) DaemonSets

func (c *FakeExperimental) DaemonSets(namespace string) client.DaemonSetInterface

func (*FakeExperimental) Deployments

func (c *FakeExperimental) Deployments(namespace string) client.DeploymentInterface

func (*FakeExperimental) HorizontalPodAutoscalers

func (c *FakeExperimental) HorizontalPodAutoscalers(namespace string) client.HorizontalPodAutoscalerInterface

func (*FakeExperimental) Ingress

func (c *FakeExperimental) Ingress(namespace string) client.IngressInterface

func (*FakeExperimental) Jobs

func (c *FakeExperimental) Jobs(namespace string) client.JobInterface

func (*FakeExperimental) Scales

func (c *FakeExperimental) Scales(namespace string) client.ScaleInterface

type FakeHorizontalPodAutoscalers

type FakeHorizontalPodAutoscalers struct {
	Fake      *FakeExperimental
	Namespace string
}

FakeHorizontalPodAutoscalers implements HorizontalPodAutoscalerInterface. Meant to be embedded into a struct to get a default implementation. This makes faking out just the methods you want to test easier.

func (*FakeHorizontalPodAutoscalers) Delete

func (c *FakeHorizontalPodAutoscalers) Delete(name string, options *api.DeleteOptions) error

func (*FakeHorizontalPodAutoscalers) Get

func (*FakeHorizontalPodAutoscalers) List

func (*FakeHorizontalPodAutoscalers) UpdateStatus

func (*FakeHorizontalPodAutoscalers) Watch

type FakeIngress

type FakeIngress struct {
	Fake      *FakeExperimental
	Namespace string
}

FakeIngress implements IngressInterface. Meant to be embedded into a struct to get a default implementation. This makes faking out just the method you want to test easier.

func (*FakeIngress) Create

func (c *FakeIngress) Create(ingress *extensions.Ingress) (*extensions.Ingress, error)

func (*FakeIngress) Delete

func (c *FakeIngress) Delete(name string, options *api.DeleteOptions) error

func (*FakeIngress) Get

func (c *FakeIngress) Get(name string) (*extensions.Ingress, error)

func (*FakeIngress) List

func (*FakeIngress) Update

func (c *FakeIngress) Update(ingress *extensions.Ingress) (*extensions.Ingress, error)

func (*FakeIngress) UpdateStatus

func (c *FakeIngress) UpdateStatus(ingress *extensions.Ingress) (result *extensions.Ingress, err error)

func (*FakeIngress) Watch

func (c *FakeIngress) Watch(label labels.Selector, field fields.Selector, opts api.ListOptions) (watch.Interface, error)

type FakeJobs

type FakeJobs struct {
	Fake      *FakeExperimental
	Namespace string
}

FakeJobs implements JobInterface. Meant to be embedded into a struct to get a default implementation. This makes faking out just the method you want to test easier.

func (*FakeJobs) Create

func (c *FakeJobs) Create(job *extensions.Job) (*extensions.Job, error)

func (*FakeJobs) Delete

func (c *FakeJobs) Delete(name string, options *api.DeleteOptions) error

func (*FakeJobs) Get

func (c *FakeJobs) Get(name string) (*extensions.Job, error)

func (*FakeJobs) List

func (c *FakeJobs) List(label labels.Selector, fields fields.Selector) (*extensions.JobList, error)

func (*FakeJobs) Update

func (c *FakeJobs) Update(job *extensions.Job) (*extensions.Job, error)

func (*FakeJobs) UpdateStatus

func (c *FakeJobs) UpdateStatus(job *extensions.Job) (result *extensions.Job, err error)

func (*FakeJobs) Watch

func (c *FakeJobs) Watch(label labels.Selector, field fields.Selector, opts api.ListOptions) (watch.Interface, error)

type FakeLimitRanges

type FakeLimitRanges struct {
	Fake      *Fake
	Namespace string
}

FakeLimitRanges implements PodsInterface. Meant to be embedded into a struct to get a default implementation. This makes faking out just the methods you want to test easier.

func (*FakeLimitRanges) Create

func (c *FakeLimitRanges) Create(limitRange *api.LimitRange) (*api.LimitRange, error)

func (*FakeLimitRanges) Delete

func (c *FakeLimitRanges) Delete(name string) error

func (*FakeLimitRanges) Get

func (c *FakeLimitRanges) Get(name string) (*api.LimitRange, error)

func (*FakeLimitRanges) List

func (*FakeLimitRanges) Update

func (c *FakeLimitRanges) Update(limitRange *api.LimitRange) (*api.LimitRange, error)

func (*FakeLimitRanges) Watch

type FakeNamespaces

type FakeNamespaces struct {
	Fake *Fake
}

FakeNamespaces implements NamespacesInterface. Meant to be embedded into a struct to get a default implementation. This makes faking out just the methods you want to test easier.

func (*FakeNamespaces) Create

func (c *FakeNamespaces) Create(namespace *api.Namespace) (*api.Namespace, error)

func (*FakeNamespaces) Delete

func (c *FakeNamespaces) Delete(name string) error

func (*FakeNamespaces) Finalize

func (c *FakeNamespaces) Finalize(namespace *api.Namespace) (*api.Namespace, error)

func (*FakeNamespaces) Get

func (c *FakeNamespaces) Get(name string) (*api.Namespace, error)

func (*FakeNamespaces) List

func (c *FakeNamespaces) List(label labels.Selector, field fields.Selector) (*api.NamespaceList, error)

func (*FakeNamespaces) Status

func (c *FakeNamespaces) Status(namespace *api.Namespace) (*api.Namespace, error)

func (*FakeNamespaces) Update

func (c *FakeNamespaces) Update(namespace *api.Namespace) (*api.Namespace, error)

func (*FakeNamespaces) Watch

func (c *FakeNamespaces) Watch(label labels.Selector, field fields.Selector, opts api.ListOptions) (watch.Interface, error)

type FakeNodes

type FakeNodes struct {
	Fake *Fake
}

FakeNodes implements NodeInterface. Meant to be embedded into a struct to get a default implementation. This makes faking out just the method you want to test easier.

func (*FakeNodes) Create

func (c *FakeNodes) Create(node *api.Node) (*api.Node, error)

func (*FakeNodes) Delete

func (c *FakeNodes) Delete(name string) error

func (*FakeNodes) Get

func (c *FakeNodes) Get(name string) (*api.Node, error)

func (*FakeNodes) List

func (c *FakeNodes) List(label labels.Selector, field fields.Selector) (*api.NodeList, error)

func (*FakeNodes) Update

func (c *FakeNodes) Update(node *api.Node) (*api.Node, error)

func (*FakeNodes) UpdateStatus

func (c *FakeNodes) UpdateStatus(node *api.Node) (*api.Node, error)

func (*FakeNodes) Watch

func (c *FakeNodes) Watch(label labels.Selector, field fields.Selector, opts api.ListOptions) (watch.Interface, error)

type FakePersistentVolumeClaims

type FakePersistentVolumeClaims struct {
	Fake      *Fake
	Namespace string
}

func (*FakePersistentVolumeClaims) Create

func (*FakePersistentVolumeClaims) Delete

func (c *FakePersistentVolumeClaims) Delete(name string) error

func (*FakePersistentVolumeClaims) Get

func (*FakePersistentVolumeClaims) List

func (*FakePersistentVolumeClaims) Update

func (*FakePersistentVolumeClaims) UpdateStatus

func (*FakePersistentVolumeClaims) Watch

type FakePersistentVolumes

type FakePersistentVolumes struct {
	Fake *Fake
}

func (*FakePersistentVolumes) Create

func (*FakePersistentVolumes) Delete

func (c *FakePersistentVolumes) Delete(name string) error

func (*FakePersistentVolumes) Get

func (*FakePersistentVolumes) List

func (*FakePersistentVolumes) Update

func (*FakePersistentVolumes) UpdateStatus

func (*FakePersistentVolumes) Watch

type FakePodTemplates

type FakePodTemplates struct {
	Fake      *Fake
	Namespace string
}

FakePodTemplates implements PodTemplatesInterface. Meant to be embedded into a struct to get a default implementation. This makes faking out just the methods you want to test easier.

func (*FakePodTemplates) Create

func (c *FakePodTemplates) Create(pod *api.PodTemplate) (*api.PodTemplate, error)

func (*FakePodTemplates) Delete

func (c *FakePodTemplates) Delete(name string, options *api.DeleteOptions) error

func (*FakePodTemplates) Get

func (c *FakePodTemplates) Get(name string) (*api.PodTemplate, error)

func (*FakePodTemplates) List

func (*FakePodTemplates) Update

func (c *FakePodTemplates) Update(pod *api.PodTemplate) (*api.PodTemplate, error)

func (*FakePodTemplates) Watch

type FakePods

type FakePods struct {
	Fake      *Fake
	Namespace string
}

FakePods implements PodsInterface. Meant to be embedded into a struct to get a default implementation. This makes faking out just the methods you want to test easier.

func (*FakePods) Bind

func (c *FakePods) Bind(binding *api.Binding) error

func (*FakePods) Create

func (c *FakePods) Create(pod *api.Pod) (*api.Pod, error)

func (*FakePods) Delete

func (c *FakePods) Delete(name string, options *api.DeleteOptions) error

func (*FakePods) Get

func (c *FakePods) Get(name string) (*api.Pod, error)

func (*FakePods) List

func (c *FakePods) List(label labels.Selector, field fields.Selector) (*api.PodList, error)

func (*FakePods) Update

func (c *FakePods) Update(pod *api.Pod) (*api.Pod, error)

func (*FakePods) UpdateStatus

func (c *FakePods) UpdateStatus(pod *api.Pod) (*api.Pod, error)

func (*FakePods) Watch

func (c *FakePods) Watch(label labels.Selector, field fields.Selector, opts api.ListOptions) (watch.Interface, error)

type FakeReplicationControllers

type FakeReplicationControllers struct {
	Fake      *Fake
	Namespace string
}

FakeReplicationControllers implements ReplicationControllerInterface. Meant to be embedded into a struct to get a default implementation. This makes faking out just the method you want to test easier.

func (*FakeReplicationControllers) Create

func (*FakeReplicationControllers) Delete

func (c *FakeReplicationControllers) Delete(name string) error

func (*FakeReplicationControllers) Get

func (*FakeReplicationControllers) List

func (*FakeReplicationControllers) Update

func (*FakeReplicationControllers) UpdateStatus

func (*FakeReplicationControllers) Watch

type FakeResourceQuotas

type FakeResourceQuotas struct {
	Fake      *Fake
	Namespace string
}

FakeResourceQuotas implements ResourceQuotaInterface. Meant to be embedded into a struct to get a default implementation. This makes faking out just the methods you want to test easier.

func (*FakeResourceQuotas) Create

func (c *FakeResourceQuotas) Create(resourceQuota *api.ResourceQuota) (*api.ResourceQuota, error)

func (*FakeResourceQuotas) Delete

func (c *FakeResourceQuotas) Delete(name string) error

func (*FakeResourceQuotas) Get

func (c *FakeResourceQuotas) Get(name string) (*api.ResourceQuota, error)

func (*FakeResourceQuotas) List

func (*FakeResourceQuotas) Update

func (c *FakeResourceQuotas) Update(resourceQuota *api.ResourceQuota) (*api.ResourceQuota, error)

func (*FakeResourceQuotas) UpdateStatus

func (c *FakeResourceQuotas) UpdateStatus(resourceQuota *api.ResourceQuota) (*api.ResourceQuota, error)

func (*FakeResourceQuotas) Watch

type FakeScales

type FakeScales struct {
	Fake      *FakeExperimental
	Namespace string
}

FakeScales implements ScaleInterface. Meant to be embedded into a struct to get a default implementation. This makes faking out just the methods you want to test easier.

func (*FakeScales) Get

func (c *FakeScales) Get(kind string, name string) (result *extensions.Scale, err error)

func (*FakeScales) Update

func (c *FakeScales) Update(kind string, scale *extensions.Scale) (result *extensions.Scale, err error)

type FakeSecrets

type FakeSecrets struct {
	Fake      *Fake
	Namespace string
}

Fake implements SecretInterface. Meant to be embedded into a struct to get a default implementation. This makes faking out just the method you want to test easier.

func (*FakeSecrets) Create

func (c *FakeSecrets) Create(secret *api.Secret) (*api.Secret, error)

func (*FakeSecrets) Delete

func (c *FakeSecrets) Delete(name string) error

func (*FakeSecrets) Get

func (c *FakeSecrets) Get(name string) (*api.Secret, error)

func (*FakeSecrets) List

func (c *FakeSecrets) List(label labels.Selector, field fields.Selector) (*api.SecretList, error)

func (*FakeSecrets) Update

func (c *FakeSecrets) Update(secret *api.Secret) (*api.Secret, error)

func (*FakeSecrets) Watch

func (c *FakeSecrets) Watch(label labels.Selector, field fields.Selector, opts api.ListOptions) (watch.Interface, error)

type FakeServiceAccounts

type FakeServiceAccounts struct {
	Fake      *Fake
	Namespace string
}

FakeServiceAccounts implements ServiceAccountsInterface. Meant to be embedded into a struct to get a default implementation. This makes faking out just the method you want to test easier.

func (*FakeServiceAccounts) Create

func (c *FakeServiceAccounts) Create(serviceAccount *api.ServiceAccount) (*api.ServiceAccount, error)

func (*FakeServiceAccounts) Delete

func (c *FakeServiceAccounts) Delete(name string) error

func (*FakeServiceAccounts) Get

func (*FakeServiceAccounts) List

func (*FakeServiceAccounts) Update

func (c *FakeServiceAccounts) Update(serviceAccount *api.ServiceAccount) (*api.ServiceAccount, error)

func (*FakeServiceAccounts) Watch

type FakeServices

type FakeServices struct {
	Fake      *Fake
	Namespace string
}

Fake implements ServiceInterface. Meant to be embedded into a struct to get a default implementation. This makes faking out just the method you want to test easier.

func (*FakeServices) Create

func (c *FakeServices) Create(service *api.Service) (*api.Service, error)

func (*FakeServices) Delete

func (c *FakeServices) Delete(name string) error

func (*FakeServices) Get

func (c *FakeServices) Get(name string) (*api.Service, error)

func (*FakeServices) List

func (c *FakeServices) List(label labels.Selector, field fields.Selector) (*api.ServiceList, error)

func (*FakeServices) ProxyGet

func (c *FakeServices) ProxyGet(name, path string, params map[string]string) unversioned.ResponseWrapper

func (*FakeServices) Update

func (c *FakeServices) Update(service *api.Service) (*api.Service, error)

func (*FakeServices) Watch

func (c *FakeServices) Watch(label labels.Selector, field fields.Selector, opts api.ListOptions) (watch.Interface, error)

type GenericAction

type GenericAction interface {
	Action
	GetValue() interface{}
}

type GenericActionImpl

type GenericActionImpl struct {
	ActionImpl
	Value interface{}
}

func (GenericActionImpl) GetValue

func (a GenericActionImpl) GetValue() interface{}

type GetAction

type GetAction interface {
	Action
	GetName() string
}

type GetActionImpl

type GetActionImpl struct {
	ActionImpl
	Name string
}

func NewGetAction

func NewGetAction(resource, namespace, name string) GetActionImpl

func NewRootGetAction

func NewRootGetAction(resource, name string) GetActionImpl

func (GetActionImpl) GetName

func (a GetActionImpl) GetName() string

type ListAction

type ListAction interface {
	Action
	GetListRestrictions() ListRestrictions
}

type ListActionImpl

type ListActionImpl struct {
	ActionImpl
	ListRestrictions ListRestrictions
}

func NewListAction

func NewListAction(resource, namespace string, label labels.Selector, field fields.Selector) ListActionImpl

func NewRootListAction

func NewRootListAction(resource string, label labels.Selector, field fields.Selector) ListActionImpl

func (ListActionImpl) GetListRestrictions

func (a ListActionImpl) GetListRestrictions() ListRestrictions

type ListRestrictions

type ListRestrictions struct {
	Labels labels.Selector
	Fields fields.Selector
}

type ObjectRetriever

type ObjectRetriever interface {
	// Kind should return a resource or a list of resources (depending on the provided kind and
	// name). It should return an error if the caller should communicate an error to the server.
	Kind(kind, name string) (runtime.Object, error)
	// Add adds a runtime object for test purposes into this object.
	Add(runtime.Object) error
}

ObjectRetriever abstracts the implementation for retrieving or setting generic objects. It is intended to be used to fake calls to a server by returning objects based on their kind and name.

func NewObjects

func NewObjects(scheme runtime.ObjectScheme, decoder runtime.ObjectDecoder) ObjectRetriever

NewObjects implements the ObjectRetriever interface by introspecting the objects provided to Add() and returning them when the Kind method is invoked. If an api.List object is provided to Add(), each child item is added. If an object is added that is itself a list (PodList, ServiceList) then that is added to the "PodList" kind. If no PodList is added, the retriever will take any loaded Pods and return them in a list. If an api.Status is added, and the Details.Kind field is set, that status will be returned instead (as an error if Status != Success, or as a runtime.Object if Status == Success). If multiple PodLists are provided, they will be returned in order by the Kind call, and the last PodList will be reused for subsequent calls.

type PatchActionImpl

type PatchActionImpl struct {
	ActionImpl
	Object runtime.Object
}

func NewPatchAction

func NewPatchAction(resource, namespace string, object runtime.Object) PatchActionImpl

func NewRootPatchAction

func NewRootPatchAction(resource string, object runtime.Object) PatchActionImpl

func (PatchActionImpl) GetObject

func (a PatchActionImpl) GetObject() runtime.Object

type ProxyGetAction

type ProxyGetAction interface {
	Action
	GetName() string
	GetPath() string
	GetParams() map[string]string
}

type ProxyGetActionImpl

type ProxyGetActionImpl struct {
	ActionImpl
	Name   string
	Path   string
	Params map[string]string
}

func NewProxyGetAction

func NewProxyGetAction(resource, namespace, name, path string, params map[string]string) ProxyGetActionImpl

func (ProxyGetActionImpl) GetName

func (a ProxyGetActionImpl) GetName() string

func (ProxyGetActionImpl) GetParams

func (a ProxyGetActionImpl) GetParams() map[string]string

func (ProxyGetActionImpl) GetPath

func (a ProxyGetActionImpl) GetPath() string

type ProxyReactionFunc

type ProxyReactionFunc func(action Action) (handled bool, ret client.ResponseWrapper, err error)

ProxyReactionFunc is a function that returns a ResponseWrapper interface for a given Action. If "handled" is false, then the test client will continue ignore the results and continue to the next ProxyReactionFunc

type ProxyReactor

type ProxyReactor interface {
	// Handles indicates whether or not this Reactor deals with a given action
	Handles(action Action) bool
	// React handles a watch action and returns results.  It may choose to delegate by indicated handled=false
	React(action Action) (handled bool, ret client.ResponseWrapper, err error)
}

ProxyReactor is an interface to allow the composition of proxy get functions.

type ReactionFunc

type ReactionFunc func(action Action) (handled bool, ret runtime.Object, err error)

ReactionFunc is a function that returns an object or error for a given Action. If "handled" is false, then the test client will continue ignore the results and continue to the next ReactionFunc

func ObjectReaction

func ObjectReaction(o ObjectRetriever, mapper meta.RESTMapper) ReactionFunc

ObjectReaction returns a ReactionFunc that takes a generic action string of the form <verb>-<resource> or <verb>-<subresource>-<resource> and attempts to return a runtime Object or error that matches the requested action. For instance, list-replicationControllers should attempt to return a list of replication controllers. This method delegates to the ObjectRetriever interface to satisfy retrieval of lists or retrieval of single items. TODO: add support for sub resources

type Reactor

type Reactor interface {
	// Handles indicates whether or not this Reactor deals with a given action
	Handles(action Action) bool
	// React handles the action and returns results.  It may choose to delegate by indicated handled=false
	React(action Action) (handled bool, ret runtime.Object, err error)
}

Reactor is an interface to allow the composition of reaction functions.

type SimpleProxyReactor

type SimpleProxyReactor struct {
	Resource string

	Reaction ProxyReactionFunc
}

SimpleProxyReactor is a ProxyReactor. Each reaction function is attached to a given resource. "*" matches everything for that value. For instance, *,pods matches all verbs on pods. This allows for easier composition of reaction functions.

func (*SimpleProxyReactor) Handles

func (r *SimpleProxyReactor) Handles(action Action) bool

func (*SimpleProxyReactor) React

type SimpleReactor

type SimpleReactor struct {
	Verb     string
	Resource string

	Reaction ReactionFunc
}

SimpleReactor is a Reactor. Each reaction function is attached to a given verb,resource tuple. "*" in either field matches everything for that value. For instance, *,pods matches all verbs on pods. This allows for easier composition of reaction functions

func (*SimpleReactor) Handles

func (r *SimpleReactor) Handles(action Action) bool

func (*SimpleReactor) React

func (r *SimpleReactor) React(action Action) (bool, runtime.Object, error)

type SimpleWatchReactor

type SimpleWatchReactor struct {
	Resource string

	Reaction WatchReactionFunc
}

SimpleWatchReactor is a WatchReactor. Each reaction function is attached to a given resource. "*" matches everything for that value. For instance, *,pods matches all verbs on pods. This allows for easier composition of reaction functions

func (*SimpleWatchReactor) Handles

func (r *SimpleWatchReactor) Handles(action Action) bool

func (*SimpleWatchReactor) React

func (r *SimpleWatchReactor) React(action Action) (bool, watch.Interface, error)

type UpdateAction

type UpdateAction interface {
	Action
	GetObject() runtime.Object
}

type UpdateActionImpl

type UpdateActionImpl struct {
	ActionImpl
	Object runtime.Object
}

func NewRootUpdateAction

func NewRootUpdateAction(resource string, object runtime.Object) UpdateActionImpl

func NewUpdateAction

func NewUpdateAction(resource, namespace string, object runtime.Object) UpdateActionImpl

func NewUpdateSubresourceAction

func NewUpdateSubresourceAction(resource, subresource, namespace string, object runtime.Object) UpdateActionImpl

func (UpdateActionImpl) GetObject

func (a UpdateActionImpl) GetObject() runtime.Object

type WatchAction

type WatchAction interface {
	Action
	GetWatchRestrictions() WatchRestrictions
}

type WatchActionImpl

type WatchActionImpl struct {
	ActionImpl
	WatchRestrictions WatchRestrictions
}

func NewRootWatchAction

func NewRootWatchAction(resource string, label labels.Selector, field fields.Selector, opts api.ListOptions) WatchActionImpl

func NewWatchAction

func NewWatchAction(resource, namespace string, label labels.Selector, field fields.Selector, opts api.ListOptions) WatchActionImpl

func (WatchActionImpl) GetWatchRestrictions

func (a WatchActionImpl) GetWatchRestrictions() WatchRestrictions

type WatchReactionFunc

type WatchReactionFunc func(action Action) (handled bool, ret watch.Interface, err error)

WatchReactionFunc is a function that returns a watch interface. If "handled" is false, then the test client will continue ignore the results and continue to the next ReactionFunc

func DefaultWatchReactor

func DefaultWatchReactor(watchInterface watch.Interface, err error) WatchReactionFunc

type WatchReactor

type WatchReactor interface {
	// Handles indicates whether or not this Reactor deals with a given action
	Handles(action Action) bool
	// React handles a watch action and returns results.  It may choose to delegate by indicated handled=false
	React(action Action) (handled bool, ret watch.Interface, err error)
}

WatchReactor is an interface to allow the composition of watch functions.

type WatchRestrictions

type WatchRestrictions struct {
	Labels          labels.Selector
	Fields          fields.Selector
	ResourceVersion string
}

Jump to

Keyboard shortcuts

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