fake

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: UPL-1.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PodExecResult = func(url *url.URL) (string, string, error) { return "", "", nil }

PodExecResult can be used to output arbitrary strings during unit testing

Functions

func NewClientsetConfig

func NewClientsetConfig(objects ...runtime.Object) (*restclient.Config, kubernetes.Interface)

func NewPodExecutor

func NewPodExecutor(config *rest.Config, method string, url *url.URL) (remotecommand.Executor, error)

NewPodExecutor should be used instead of remotecommand.NewSPDYExecutor in unit tests

Types

type WrappedClientset

type WrappedClientset struct {
	*fakeclientset.Clientset
}

There is a deficiency in the FakeCoreV1 implementation that returns a nil RESTClient To get around this limitation, we wrap the fakes in our own types, which supply a valid RESTClient for unit testing.

func (*WrappedClientset) CoreV1

type WrappedCoreV1

type WrappedCoreV1 struct {
	fakecorev1.FakeCoreV1
	RestClient restclient.Interface
}

There is a deficiency in the FakeCoreV1 implementation that returns a nil RESTClient To get around this limitation, we wrap the fakes in our own types, which supply a valid RESTClient for unit testing.

func (*WrappedCoreV1) RESTClient

func (w *WrappedCoreV1) RESTClient() restclient.Interface

Jump to

Keyboard shortcuts

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