testutils

package
v2.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: Apache-2.0 Imports: 8 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const DockerCSIPluginControllerCap = "csicontroller"
View Source
const DockerCSIPluginNodeCap = "csinode"

Variables

This section is empty.

Functions

func ErrorCode

func ErrorCode(err error) codes.Code

ErrorCode returns the error code for err if it was produced by the rpc system. Otherwise, it returns codes.Unknown.

func ErrorDesc

func ErrorDesc(err error) string

ErrorDesc returns the error description of err if it was produced by the rpc system. Otherwise, it returns err.Error() or empty string when err is nil.

func PollFunc

func PollFunc(clockSource *fakeclock.FakeClock, f func() error) error

PollFunc is like PollFuncWithTimeout with timeout=10s.

func PollFuncWithTimeout

func PollFuncWithTimeout(clockSource *fakeclock.FakeClock, f func() error, timeout time.Duration) error

PollFuncWithTimeout is used to periodically execute a check function, it returns error after timeout.

Types

type FakePlugin

type FakePlugin struct {
	PluginName string
	PluginAddr net.Addr
	Scope      string
}

func (*FakePlugin) Addr

func (f *FakePlugin) Addr() net.Addr

func (*FakePlugin) Client

func (f *FakePlugin) Client() plugin.Client

func (*FakePlugin) Name

func (f *FakePlugin) Name() string

func (*FakePlugin) ScopedPath

func (f *FakePlugin) ScopedPath(path string) string

type FakePluginGetter

type FakePluginGetter struct {
	Plugins map[string]*FakePlugin
}

func (*FakePluginGetter) Get

func (f *FakePluginGetter) Get(name, capability string) (plugin.Plugin, error)

func (*FakePluginGetter) GetAllManagedPluginsByCap

func (f *FakePluginGetter) GetAllManagedPluginsByCap(capability string) []plugin.Plugin

GetAllManagedPluginsByCap returns all of the fake's plugins. If capability is anything other than DockerCSIPluginCap, it returns nothing.

Jump to

Keyboard shortcuts

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