test

package
v1.1.0-beta.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIResource

type APIResource struct {
	Group      string
	Version    string
	Name       string
	ShortName  string
	Namespaced bool
	Items      []metav1.Object
}

APIResource stores information about a specific Kubernetes API resource.

func Deployments

func Deployments(items ...metav1.Object) *APIResource

func ExtensionsDeployments

func ExtensionsDeployments(items ...metav1.Object) *APIResource

func Namespaces

func Namespaces(items ...metav1.Object) *APIResource

func PVCs

func PVCs(items ...metav1.Object) *APIResource

func PVs

func PVs(items ...metav1.Object) *APIResource

func Pods

func Pods(items ...metav1.Object) *APIResource

Pods returns an APIResource describing core/v1's Pods.

func Secrets

func Secrets(items ...metav1.Object) *APIResource

func ServiceAccounts

func ServiceAccounts(items ...metav1.Object) *APIResource

func (*APIResource) GVR

GVR returns a GroupVersionResource representing the resource.

type APIServer

type APIServer struct {
	VeleroClient    *fake.Clientset
	KubeClient      *kubefake.Clientset
	DynamicClient   *dynamicfake.FakeDynamicClient
	DiscoveryClient *DiscoveryClient
}

APIServer contains in-memory fakes for all of the relevant Kubernetes API server clients.

func NewAPIServer

func NewAPIServer(t *testing.T) *APIServer

NewAPIServer constructs an APIServer with all of its clients initialized.

type DiscoveryClient

type DiscoveryClient struct {
	*discoveryfake.FakeDiscovery
}

DiscoveryClient is a wrapper for the client-go FakeDiscovery struct. It adds some extra functionality that's necessary/useful for Velero tests.

func (*DiscoveryClient) ServerPreferredResources

func (c *DiscoveryClient) ServerPreferredResources() ([]*metav1.APIResourceList, error)

func (*DiscoveryClient) WithAPIResource

func (c *DiscoveryClient) WithAPIResource(resource *APIResource) *DiscoveryClient

WithAPIResource adds the API resource to the discovery client.

Jump to

Keyboard shortcuts

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