test

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: EPL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeClientProvider

type FakeClientProvider struct {
	InitialObjs    []runtime.Object
	InitialDynamic []runtime.Object
	UserToken      string
}

FakeClientProvider returns fake clientsets and dynamic clients that are initialized with objects. UserToken is used to verify that expected token is passed to NewClientWithToken()

func (FakeClientProvider) NewClientWithToken

func (p FakeClientProvider) NewClientWithToken(token string) (kubernetes.Interface, *rest.Config, error)

func (FakeClientProvider) NewDevWorkspaceClient

func (p FakeClientProvider) NewDevWorkspaceClient() (dynamic.Interface, *rest.Config, error)

func (FakeClientProvider) NewOpenShiftUserClient

func (p FakeClientProvider) NewOpenShiftUserClient(token string) (dynamic.Interface, *rest.Config, error)

type FakeSPDYExecutor

type FakeSPDYExecutor struct {
	InputBuffers    []string
	ResponseOutputs map[string]string
	ResponseStdErr  map[string]string
	ErrInputs       []string
}

FakeSPDYExecutor is a fake SPDYExecutor that allows configuring output for a given input Inputs are saved in order to allow verifying commands that were executed.

func (*FakeSPDYExecutor) Stream

type FakeSPDYExecutorProvider

type FakeSPDYExecutorProvider struct {
	FakeSPDYExecutor
}

FakeSPDYExecutorProvider provides a function that allows replacing remotecommand.NewSPDYExecutor

func (*FakeSPDYExecutorProvider) NewFakeSPDYExecutor

func (f *FakeSPDYExecutorProvider) NewFakeSPDYExecutor(_ *rest.Config, _ string, _ *url.URL) (remotecommand.Executor, error)

type NoOpClientProvider

type NoOpClientProvider struct{}

NoOpClientProvider returns nil for all functions in the interface, for use in tests where clients are not expected to be used

func (NoOpClientProvider) NewClientWithToken

func (NoOpClientProvider) NewClientWithToken(token string) (kubernetes.Interface, *rest.Config, error)

func (NoOpClientProvider) NewDevWorkspaceClient

func (NoOpClientProvider) NewDevWorkspaceClient() (dynamic.Interface, *rest.Config, error)

func (NoOpClientProvider) NewOpenShiftUserClient

func (NoOpClientProvider) NewOpenShiftUserClient(token string) (dynamic.Interface, *rest.Config, error)

type WrapFakeClientCoreV1

type WrapFakeClientCoreV1 struct {
	*fake.Clientset
}

Functions below are to wrap the RESTClient in fake.Clientset (which is by default nil) This is required to allow allow resolving requests for pods/exec in tests.

func (*WrapFakeClientCoreV1) CoreV1

Jump to

Keyboard shortcuts

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