testing

package
v1.30.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 17 Imported by: 82

Documentation

Overview

Package testing is a generated GoMock package.

Package testing is a generated GoMock package.

Index

Constants

View Source
const FakeHost = "localhost:12345"

Variables

This section is empty.

Functions

func NewFakeCache

func NewFakeCache(runtime container.Runtime) container.Cache

func NewFakeReadyProvider added in v1.29.0

func NewFakeReadyProvider() kubecontainer.SourcesReadyProvider

NewFakeReadyProvider creates a FakeReadyProvider object

func NewFakeRuntimeCache

func NewFakeRuntimeCache(getter podsGetter) kubecontainer.RuntimeCache

Types

type FakeContainerCommandRunner added in v1.5.0

type FakeContainerCommandRunner struct {
	// what to return
	Stdout string
	Err    error

	// actual values when invoked
	ContainerID kubecontainer.ContainerID
	Cmd         []string
}

func (*FakeContainerCommandRunner) RunInContainer added in v1.5.0

func (f *FakeContainerCommandRunner) RunInContainer(_ context.Context, containerID kubecontainer.ContainerID, cmd []string, timeout time.Duration) ([]byte, error)

type FakeOS

type FakeOS struct {
	StatFn     func(string) (os.FileInfo, error)
	ReadDirFn  func(string) ([]os.DirEntry, error)
	MkdirAllFn func(string, os.FileMode) error
	SymlinkFn  func(string, string) error
	GlobFn     func(string, string) bool
	HostName   string
	Removes    []string
	Files      map[string][]*os.FileInfo
	FilesLock  sync.RWMutex
}

FakeOS mocks out certain OS calls to avoid perturbing the filesystem If a member of the form `*Fn` is set, that function will be called in place of the real call.

func (*FakeOS) Chmod added in v1.6.0

func (*FakeOS) Chmod(path string, perm os.FileMode) error

Chmod is a fake call that returns nil.

func (*FakeOS) Chtimes added in v1.3.0

func (*FakeOS) Chtimes(path string, atime time.Time, mtime time.Time) error

Chtimes is a fake call that returns nil.

func (*FakeOS) Create added in v1.3.0

func (f *FakeOS) Create(path string) (*os.File, error)

Create is a fake call that creates a virtual file and returns nil.

func (*FakeOS) Glob added in v1.5.0

func (f *FakeOS) Glob(pattern string) ([]string, error)

Glob is a fake call that returns list of virtual files matching a pattern.

func (*FakeOS) Hostname added in v1.3.0

func (f *FakeOS) Hostname() (name string, err error)

Hostname is a fake call that returns nil.

func (*FakeOS) MkdirAll added in v1.3.0

func (f *FakeOS) MkdirAll(path string, perm os.FileMode) error

Mkdir is a fake call that just returns nil.

func (*FakeOS) Open added in v1.17.12

func (*FakeOS) Open(name string) (*os.File, error)

Open is a fake call that returns nil.

func (*FakeOS) OpenFile added in v1.17.12

func (*FakeOS) OpenFile(name string, flag int, perm os.FileMode) (*os.File, error)

OpenFile is a fake call that return nil.

func (*FakeOS) Pipe added in v1.3.0

func (*FakeOS) Pipe() (r *os.File, w *os.File, err error)

Pipe is a fake call that returns nil.

func (*FakeOS) ReadDir added in v1.3.0

func (f *FakeOS) ReadDir(dirname string) ([]os.DirEntry, error)

ReadDir is a fake call that returns the files under the directory.

func (*FakeOS) Remove added in v1.3.0

func (f *FakeOS) Remove(path string) error

Remove is a fake call that returns nil.

func (*FakeOS) RemoveAll added in v1.5.0

func (f *FakeOS) RemoveAll(path string) error

RemoveAll is a fake call that just returns nil.

func (*FakeOS) Rename added in v1.17.12

func (*FakeOS) Rename(oldpath, newpath string) error

Rename is a fake call that return nil.

func (*FakeOS) Stat added in v1.3.0

func (f *FakeOS) Stat(path string) (os.FileInfo, error)

Stat is a fake that returns an error

func (f *FakeOS) Symlink(oldname string, newname string) error

Symlink is a fake call that just returns nil.

type FakePod added in v1.3.0

type FakePod struct {
	Pod       *kubecontainer.Pod
	NetnsPath string
}

type FakeReadyProvider added in v1.29.0

type FakeReadyProvider struct {
	kubecontainer.SourcesReadyProvider
}

FakeReadyProvider implements a fake ready provider

func (*FakeReadyProvider) AllReady added in v1.29.0

func (frp *FakeReadyProvider) AllReady() bool

AllReady notifies caller that the Fake Provider is ready.

type FakeRuntime

type FakeRuntime struct {
	sync.Mutex
	CalledFunctions   []string
	PodList           []*FakePod
	AllPodList        []*FakePod
	ImageList         []kubecontainer.Image
	ImageFsStats      []*runtimeapi.FilesystemUsage
	ContainerFsStats  []*runtimeapi.FilesystemUsage
	APIPodStatus      v1.PodStatus
	PodStatus         kubecontainer.PodStatus
	StartedPods       []string
	KilledPods        []string
	StartedContainers []string
	KilledContainers  []string
	RuntimeStatus     *kubecontainer.RuntimeStatus
	VersionInfo       string
	APIVersionInfo    string
	RuntimeType       string
	Err               error
	InspectErr        error
	StatusErr         error
	// If BlockImagePulls is true, then all PullImage() calls will be blocked until
	// UnblockImagePulls() is called. This is used to simulate image pull latency
	// from container runtime.
	BlockImagePulls bool

	T TB
	// contains filtered or unexported fields
}

FakeRuntime is a fake container runtime for testing.

func (*FakeRuntime) APIVersion

func (f *FakeRuntime) APIVersion() (kubecontainer.Version, error)

func (*FakeRuntime) AssertCallCounts added in v1.27.0

func (f *FakeRuntime) AssertCallCounts(funcName string, expectedCount int) bool

AssertCallCounts checks if a certain call is called for a certain of numbers

func (*FakeRuntime) AssertCalls

func (f *FakeRuntime) AssertCalls(calls []string) bool

AssertCalls test if the invoked functions are as expected.

func (*FakeRuntime) AssertKilledContainers

func (f *FakeRuntime) AssertKilledContainers(containers []string) bool

func (*FakeRuntime) AssertKilledPods

func (f *FakeRuntime) AssertKilledPods(pods []string) bool

func (*FakeRuntime) AssertStartedContainers

func (f *FakeRuntime) AssertStartedContainers(containers []string) bool

func (*FakeRuntime) AssertStartedPods

func (f *FakeRuntime) AssertStartedPods(pods []string) bool

func (*FakeRuntime) CheckpointContainer added in v1.25.0

func (f *FakeRuntime) CheckpointContainer(_ context.Context, options *runtimeapi.CheckpointContainerRequest) error

func (*FakeRuntime) DeleteContainer added in v1.4.0

func (f *FakeRuntime) DeleteContainer(_ context.Context, containerID kubecontainer.ContainerID) error

func (*FakeRuntime) GarbageCollect

func (f *FakeRuntime) GarbageCollect(_ context.Context, gcPolicy kubecontainer.GCPolicy, ready bool, evictNonDeletedPods bool) error

func (*FakeRuntime) GeneratePodStatus added in v1.26.0

func (f *FakeRuntime) GeneratePodStatus(event *runtimeapi.ContainerEventResponse) (*kubecontainer.PodStatus, error)

func (*FakeRuntime) GetContainerLogs

func (f *FakeRuntime) GetContainerLogs(_ context.Context, pod *v1.Pod, containerID kubecontainer.ContainerID, logOptions *v1.PodLogOptions, stdout, stderr io.Writer) (err error)

func (*FakeRuntime) GetImageRef added in v1.6.0

func (f *FakeRuntime) GetImageRef(_ context.Context, image kubecontainer.ImageSpec) (string, error)

func (*FakeRuntime) GetImageSize added in v1.30.0

func (f *FakeRuntime) GetImageSize(_ context.Context, image kubecontainer.ImageSpec) (uint64, error)

func (*FakeRuntime) GetPodStatus

func (f *FakeRuntime) GetPodStatus(_ context.Context, uid types.UID, name, namespace string) (*kubecontainer.PodStatus, error)

func (*FakeRuntime) GetPods

func (f *FakeRuntime) GetPods(_ context.Context, all bool) ([]*kubecontainer.Pod, error)

func (*FakeRuntime) ImageFsInfo added in v1.29.0

ImageFsInfo returns a ImageFsInfoResponse given the DI injected values of ImageFsStats and ContainerFsStats.

func (*FakeRuntime) ImageStats added in v1.3.0

func (*FakeRuntime) KillContainerInPod

func (f *FakeRuntime) KillContainerInPod(container v1.Container, pod *v1.Pod) error

func (*FakeRuntime) KillPod

func (f *FakeRuntime) KillPod(_ context.Context, pod *v1.Pod, runningPod kubecontainer.Pod, gracePeriodOverride *int64) error

func (*FakeRuntime) ListImages

func (f *FakeRuntime) ListImages(_ context.Context) ([]kubecontainer.Image, error)

func (*FakeRuntime) ListMetricDescriptors added in v1.26.0

func (f *FakeRuntime) ListMetricDescriptors(_ context.Context) ([]*runtimeapi.MetricDescriptor, error)

func (*FakeRuntime) ListPodSandboxMetrics added in v1.26.0

func (f *FakeRuntime) ListPodSandboxMetrics(_ context.Context) ([]*runtimeapi.PodSandboxMetrics, error)

func (*FakeRuntime) PullImage

func (f *FakeRuntime) PullImage(ctx context.Context, image kubecontainer.ImageSpec, pullSecrets []v1.Secret, podSandboxConfig *runtimeapi.PodSandboxConfig) (string, error)

func (*FakeRuntime) RemoveImage

func (f *FakeRuntime) RemoveImage(_ context.Context, image kubecontainer.ImageSpec) error

func (*FakeRuntime) RunContainerInPod

func (f *FakeRuntime) RunContainerInPod(container v1.Container, pod *v1.Pod, volumeMap map[string]volume.VolumePlugin) error

func (*FakeRuntime) SetContainerFsStats added in v1.29.0

func (f *FakeRuntime) SetContainerFsStats(val []*runtimeapi.FilesystemUsage)

SetContainerFsStats sets the containerFsStats for dependency injection.

func (*FakeRuntime) SetImageFsStats added in v1.29.0

func (f *FakeRuntime) SetImageFsStats(val []*runtimeapi.FilesystemUsage)

SetImageFsStats sets the ImageFsStats for dependency injection.

func (*FakeRuntime) Status

func (*FakeRuntime) SyncPod

func (*FakeRuntime) Type

func (f *FakeRuntime) Type() string

func (*FakeRuntime) UnblockImagePulls added in v1.27.0

func (f *FakeRuntime) UnblockImagePulls(count int)

UnblockImagePulls unblocks a certain number of image pulls, if BlockImagePulls is true.

func (*FakeRuntime) UpdatePodCIDR added in v1.5.0

func (f *FakeRuntime) UpdatePodCIDR(_ context.Context, c string) error

UpdatePodCIDR fulfills the cri interface.

func (*FakeRuntime) Version

type FakeRuntimeCache

type FakeRuntimeCache struct {
	// contains filtered or unexported fields
}

func (*FakeRuntimeCache) ForceUpdateIfOlder

func (f *FakeRuntimeCache) ForceUpdateIfOlder(context.Context, time.Time) error

func (*FakeRuntimeCache) GetPods

func (f *FakeRuntimeCache) GetPods(ctx context.Context) ([]*kubecontainer.Pod, error)

type FakeRuntimeHelper added in v1.6.0

type FakeRuntimeHelper struct {
	DNSServers      []string
	DNSSearches     []string
	DNSOptions      []string
	HostName        string
	HostDomain      string
	PodContainerDir string
	Err             error
}

FakeRuntimeHelper implements RuntimeHelper interfaces for testing purposes.

func (*FakeRuntimeHelper) GeneratePodHostNameAndDomain added in v1.6.0

func (f *FakeRuntimeHelper) GeneratePodHostNameAndDomain(pod *v1.Pod) (string, string, error)

This is not used by docker runtime.

func (*FakeRuntimeHelper) GenerateRunContainerOptions added in v1.6.0

func (f *FakeRuntimeHelper) GenerateRunContainerOptions(_ context.Context, pod *v1.Pod, container *v1.Container, podIP string, podIPs []string) (*kubecontainer.RunContainerOptions, func(), error)

func (*FakeRuntimeHelper) GetExtraSupplementalGroupsForPod added in v1.6.0

func (f *FakeRuntimeHelper) GetExtraSupplementalGroupsForPod(pod *v1.Pod) []int64

func (*FakeRuntimeHelper) GetOrCreateUserNamespaceMappings added in v1.25.0

func (f *FakeRuntimeHelper) GetOrCreateUserNamespaceMappings(pod *v1.Pod, runtimeHandler string) (*runtimeapi.UserNamespace, error)

func (*FakeRuntimeHelper) GetPodCgroupParent added in v1.6.0

func (f *FakeRuntimeHelper) GetPodCgroupParent(pod *v1.Pod) string

func (*FakeRuntimeHelper) GetPodDNS added in v1.9.0

func (f *FakeRuntimeHelper) GetPodDNS(pod *v1.Pod) (*runtimeapi.DNSConfig, error)

func (*FakeRuntimeHelper) GetPodDir added in v1.6.0

func (f *FakeRuntimeHelper) GetPodDir(podUID kubetypes.UID) string

func (*FakeRuntimeHelper) PrepareDynamicResources added in v1.27.0

func (f *FakeRuntimeHelper) PrepareDynamicResources(pod *v1.Pod) error

func (*FakeRuntimeHelper) UnprepareDynamicResources added in v1.27.0

func (f *FakeRuntimeHelper) UnprepareDynamicResources(pod *v1.Pod) error

type FakeStreamingRuntime added in v1.11.0

type FakeStreamingRuntime struct {
	*FakeRuntime
}

func (*FakeStreamingRuntime) GetAttach added in v1.11.0

func (f *FakeStreamingRuntime) GetAttach(_ context.Context, id kubecontainer.ContainerID, stdin, stdout, stderr, tty bool) (*url.URL, error)

func (*FakeStreamingRuntime) GetExec added in v1.11.0

func (f *FakeStreamingRuntime) GetExec(_ context.Context, id kubecontainer.ContainerID, cmd []string, stdin, stdout, stderr, tty bool) (*url.URL, error)

func (*FakeStreamingRuntime) GetPortForward added in v1.11.0

func (f *FakeStreamingRuntime) GetPortForward(_ context.Context, podName, podNamespace string, podUID types.UID, ports []int32) (*url.URL, error)

type FakeVersion

type FakeVersion struct {
	Version string
}

func (*FakeVersion) Compare

func (fv *FakeVersion) Compare(other string) (int, error)

func (*FakeVersion) String

func (fv *FakeVersion) String() string

type MockAttacher added in v1.23.0

type MockAttacher struct {
	// contains filtered or unexported fields
}

MockAttacher is a mock of Attacher interface.

func NewMockAttacher added in v1.23.0

func NewMockAttacher(ctrl *gomock.Controller) *MockAttacher

NewMockAttacher creates a new mock instance.

func (*MockAttacher) AttachContainer added in v1.23.0

func (m *MockAttacher) AttachContainer(ctx context.Context, id container.ContainerID, stdin io.Reader, stdout, stderr io.WriteCloser, tty bool, resize <-chan remotecommand.TerminalSize) error

AttachContainer mocks base method.

func (*MockAttacher) EXPECT added in v1.23.0

EXPECT returns an object that allows the caller to indicate expected use.

type MockAttacherMockRecorder added in v1.23.0

type MockAttacherMockRecorder struct {
	// contains filtered or unexported fields
}

MockAttacherMockRecorder is the mock recorder for MockAttacher.

func (*MockAttacherMockRecorder) AttachContainer added in v1.23.0

func (mr *MockAttacherMockRecorder) AttachContainer(ctx, id, stdin, stdout, stderr, tty, resize interface{}) *gomock.Call

AttachContainer indicates an expected call of AttachContainer.

type MockCommandRunner added in v1.23.0

type MockCommandRunner struct {
	// contains filtered or unexported fields
}

MockCommandRunner is a mock of CommandRunner interface.

func NewMockCommandRunner added in v1.23.0

func NewMockCommandRunner(ctrl *gomock.Controller) *MockCommandRunner

NewMockCommandRunner creates a new mock instance.

func (*MockCommandRunner) EXPECT added in v1.23.0

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockCommandRunner) RunInContainer added in v1.23.0

func (m *MockCommandRunner) RunInContainer(ctx context.Context, id container.ContainerID, cmd []string, timeout time.Duration) ([]byte, error)

RunInContainer mocks base method.

type MockCommandRunnerMockRecorder added in v1.23.0

type MockCommandRunnerMockRecorder struct {
	// contains filtered or unexported fields
}

MockCommandRunnerMockRecorder is the mock recorder for MockCommandRunner.

func (*MockCommandRunnerMockRecorder) RunInContainer added in v1.23.0

func (mr *MockCommandRunnerMockRecorder) RunInContainer(ctx, id, cmd, timeout interface{}) *gomock.Call

RunInContainer indicates an expected call of RunInContainer.

type MockDirEntry added in v1.26.0

type MockDirEntry struct {
	// contains filtered or unexported fields
}

MockDirEntry is a mock of DirEntry interface.

func NewMockDirEntry added in v1.26.0

func NewMockDirEntry(ctrl *gomock.Controller) *MockDirEntry

NewMockDirEntry creates a new mock instance.

func (*MockDirEntry) EXPECT added in v1.26.0

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockDirEntry) Info added in v1.26.0

func (m *MockDirEntry) Info() (fs.FileInfo, error)

Info mocks base method.

func (*MockDirEntry) IsDir added in v1.26.0

func (m *MockDirEntry) IsDir() bool

IsDir mocks base method.

func (*MockDirEntry) Name added in v1.26.0

func (m *MockDirEntry) Name() string

Name mocks base method.

func (*MockDirEntry) Type added in v1.26.0

func (m *MockDirEntry) Type() fs.FileMode

Type mocks base method.

type MockDirEntryMockRecorder added in v1.26.0

type MockDirEntryMockRecorder struct {
	// contains filtered or unexported fields
}

MockDirEntryMockRecorder is the mock recorder for MockDirEntry.

func (*MockDirEntryMockRecorder) Info added in v1.26.0

func (mr *MockDirEntryMockRecorder) Info() *gomock.Call

Info indicates an expected call of Info.

func (*MockDirEntryMockRecorder) IsDir added in v1.26.0

func (mr *MockDirEntryMockRecorder) IsDir() *gomock.Call

IsDir indicates an expected call of IsDir.

func (*MockDirEntryMockRecorder) Name added in v1.26.0

func (mr *MockDirEntryMockRecorder) Name() *gomock.Call

Name indicates an expected call of Name.

func (*MockDirEntryMockRecorder) Type added in v1.26.0

func (mr *MockDirEntryMockRecorder) Type() *gomock.Call

Type indicates an expected call of Type.

type MockImageService added in v1.23.0

type MockImageService struct {
	// contains filtered or unexported fields
}

MockImageService is a mock of ImageService interface.

func NewMockImageService added in v1.23.0

func NewMockImageService(ctrl *gomock.Controller) *MockImageService

NewMockImageService creates a new mock instance.

func (*MockImageService) EXPECT added in v1.23.0

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockImageService) GetImageRef added in v1.23.0

func (m *MockImageService) GetImageRef(ctx context.Context, image container.ImageSpec) (string, error)

GetImageRef mocks base method.

func (*MockImageService) GetImageSize added in v1.30.0

func (m *MockImageService) GetImageSize(ctx context.Context, image container.ImageSpec) (uint64, error)

GetImageSize mocks base method.

func (*MockImageService) ImageFsInfo added in v1.29.0

func (m *MockImageService) ImageFsInfo(ctx context.Context) (*v10.ImageFsInfoResponse, error)

ImageFsInfo mocks base method.

func (*MockImageService) ImageStats added in v1.23.0

func (m *MockImageService) ImageStats(ctx context.Context) (*container.ImageStats, error)

ImageStats mocks base method.

func (*MockImageService) ListImages added in v1.23.0

func (m *MockImageService) ListImages(ctx context.Context) ([]container.Image, error)

ListImages mocks base method.

func (*MockImageService) PullImage added in v1.23.0

func (m *MockImageService) PullImage(ctx context.Context, image container.ImageSpec, pullSecrets []v1.Secret, podSandboxConfig *v10.PodSandboxConfig) (string, error)

PullImage mocks base method.

func (*MockImageService) RemoveImage added in v1.23.0

func (m *MockImageService) RemoveImage(ctx context.Context, image container.ImageSpec) error

RemoveImage mocks base method.

type MockImageServiceMockRecorder added in v1.23.0

type MockImageServiceMockRecorder struct {
	// contains filtered or unexported fields
}

MockImageServiceMockRecorder is the mock recorder for MockImageService.

func (*MockImageServiceMockRecorder) GetImageRef added in v1.23.0

func (mr *MockImageServiceMockRecorder) GetImageRef(ctx, image interface{}) *gomock.Call

GetImageRef indicates an expected call of GetImageRef.

func (*MockImageServiceMockRecorder) GetImageSize added in v1.30.0

func (mr *MockImageServiceMockRecorder) GetImageSize(ctx, image interface{}) *gomock.Call

GetImageSize indicates an expected call of GetImageSize.

func (*MockImageServiceMockRecorder) ImageFsInfo added in v1.29.0

func (mr *MockImageServiceMockRecorder) ImageFsInfo(ctx interface{}) *gomock.Call

ImageFsInfo indicates an expected call of ImageFsInfo.

func (*MockImageServiceMockRecorder) ImageStats added in v1.23.0

func (mr *MockImageServiceMockRecorder) ImageStats(ctx interface{}) *gomock.Call

ImageStats indicates an expected call of ImageStats.

func (*MockImageServiceMockRecorder) ListImages added in v1.23.0

func (mr *MockImageServiceMockRecorder) ListImages(ctx interface{}) *gomock.Call

ListImages indicates an expected call of ListImages.

func (*MockImageServiceMockRecorder) PullImage added in v1.23.0

func (mr *MockImageServiceMockRecorder) PullImage(ctx, image, pullSecrets, podSandboxConfig interface{}) *gomock.Call

PullImage indicates an expected call of PullImage.

func (*MockImageServiceMockRecorder) RemoveImage added in v1.23.0

func (mr *MockImageServiceMockRecorder) RemoveImage(ctx, image interface{}) *gomock.Call

RemoveImage indicates an expected call of RemoveImage.

type MockRuntime added in v1.23.0

type MockRuntime struct {
	// contains filtered or unexported fields
}

MockRuntime is a mock of Runtime interface.

func NewMockRuntime added in v1.23.0

func NewMockRuntime(ctrl *gomock.Controller) *MockRuntime

NewMockRuntime creates a new mock instance.

func (*MockRuntime) APIVersion added in v1.23.0

func (m *MockRuntime) APIVersion() (container.Version, error)

APIVersion mocks base method.

func (*MockRuntime) CheckpointContainer added in v1.25.0

func (m *MockRuntime) CheckpointContainer(ctx context.Context, options *v10.CheckpointContainerRequest) error

CheckpointContainer mocks base method.

func (*MockRuntime) DeleteContainer added in v1.23.0

func (m *MockRuntime) DeleteContainer(ctx context.Context, containerID container.ContainerID) error

DeleteContainer mocks base method.

func (*MockRuntime) EXPECT added in v1.23.0

func (m *MockRuntime) EXPECT() *MockRuntimeMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockRuntime) GarbageCollect added in v1.23.0

func (m *MockRuntime) GarbageCollect(ctx context.Context, gcPolicy container.GCPolicy, allSourcesReady, evictNonDeletedPods bool) error

GarbageCollect mocks base method.

func (*MockRuntime) GeneratePodStatus added in v1.26.0

func (m *MockRuntime) GeneratePodStatus(event *v10.ContainerEventResponse) (*container.PodStatus, error)

GeneratePodStatus mocks base method.

func (*MockRuntime) GetContainerLogs added in v1.23.0

func (m *MockRuntime) GetContainerLogs(ctx context.Context, pod *v1.Pod, containerID container.ContainerID, logOptions *v1.PodLogOptions, stdout, stderr io.Writer) error

GetContainerLogs mocks base method.

func (*MockRuntime) GetImageRef added in v1.23.0

func (m *MockRuntime) GetImageRef(ctx context.Context, image container.ImageSpec) (string, error)

GetImageRef mocks base method.

func (*MockRuntime) GetImageSize added in v1.30.0

func (m *MockRuntime) GetImageSize(ctx context.Context, image container.ImageSpec) (uint64, error)

GetImageSize mocks base method.

func (*MockRuntime) GetPodStatus added in v1.23.0

func (m *MockRuntime) GetPodStatus(ctx context.Context, uid types.UID, name, namespace string) (*container.PodStatus, error)

GetPodStatus mocks base method.

func (*MockRuntime) GetPods added in v1.23.0

func (m *MockRuntime) GetPods(ctx context.Context, all bool) ([]*container.Pod, error)

GetPods mocks base method.

func (*MockRuntime) ImageFsInfo added in v1.29.0

func (m *MockRuntime) ImageFsInfo(ctx context.Context) (*v10.ImageFsInfoResponse, error)

ImageFsInfo mocks base method.

func (*MockRuntime) ImageStats added in v1.23.0

func (m *MockRuntime) ImageStats(ctx context.Context) (*container.ImageStats, error)

ImageStats mocks base method.

func (*MockRuntime) KillPod added in v1.23.0

func (m *MockRuntime) KillPod(ctx context.Context, pod *v1.Pod, runningPod container.Pod, gracePeriodOverride *int64) error

KillPod mocks base method.

func (*MockRuntime) ListImages added in v1.23.0

func (m *MockRuntime) ListImages(ctx context.Context) ([]container.Image, error)

ListImages mocks base method.

func (*MockRuntime) ListMetricDescriptors added in v1.26.0

func (m *MockRuntime) ListMetricDescriptors(ctx context.Context) ([]*v10.MetricDescriptor, error)

ListMetricDescriptors mocks base method.

func (*MockRuntime) ListPodSandboxMetrics added in v1.26.0

func (m *MockRuntime) ListPodSandboxMetrics(ctx context.Context) ([]*v10.PodSandboxMetrics, error)

ListPodSandboxMetrics mocks base method.

func (*MockRuntime) PullImage added in v1.23.0

func (m *MockRuntime) PullImage(ctx context.Context, image container.ImageSpec, pullSecrets []v1.Secret, podSandboxConfig *v10.PodSandboxConfig) (string, error)

PullImage mocks base method.

func (*MockRuntime) RemoveImage added in v1.23.0

func (m *MockRuntime) RemoveImage(ctx context.Context, image container.ImageSpec) error

RemoveImage mocks base method.

func (*MockRuntime) Status added in v1.23.0

Status mocks base method.

func (*MockRuntime) SyncPod added in v1.23.0

func (m *MockRuntime) SyncPod(ctx context.Context, pod *v1.Pod, podStatus *container.PodStatus, pullSecrets []v1.Secret, backOff *flowcontrol.Backoff) container.PodSyncResult

SyncPod mocks base method.

func (*MockRuntime) Type added in v1.23.0

func (m *MockRuntime) Type() string

Type mocks base method.

func (*MockRuntime) UpdatePodCIDR added in v1.23.0

func (m *MockRuntime) UpdatePodCIDR(ctx context.Context, podCIDR string) error

UpdatePodCIDR mocks base method.

func (*MockRuntime) Version added in v1.23.0

func (m *MockRuntime) Version(ctx context.Context) (container.Version, error)

Version mocks base method.

type MockRuntimeCache added in v1.8.0

type MockRuntimeCache struct {
	// contains filtered or unexported fields
}

MockRuntimeCache is a mock of RuntimeCache interface.

func NewMockRuntimeCache added in v1.23.0

func NewMockRuntimeCache(ctrl *gomock.Controller) *MockRuntimeCache

NewMockRuntimeCache creates a new mock instance.

func (*MockRuntimeCache) EXPECT added in v1.23.0

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockRuntimeCache) ForceUpdateIfOlder added in v1.8.0

func (m *MockRuntimeCache) ForceUpdateIfOlder(arg0 context.Context, arg1 time.Time) error

ForceUpdateIfOlder mocks base method.

func (*MockRuntimeCache) GetPods added in v1.8.0

func (m *MockRuntimeCache) GetPods(arg0 context.Context) ([]*container.Pod, error)

GetPods mocks base method.

type MockRuntimeCacheMockRecorder added in v1.23.0

type MockRuntimeCacheMockRecorder struct {
	// contains filtered or unexported fields
}

MockRuntimeCacheMockRecorder is the mock recorder for MockRuntimeCache.

func (*MockRuntimeCacheMockRecorder) ForceUpdateIfOlder added in v1.23.0

func (mr *MockRuntimeCacheMockRecorder) ForceUpdateIfOlder(arg0, arg1 interface{}) *gomock.Call

ForceUpdateIfOlder indicates an expected call of ForceUpdateIfOlder.

func (*MockRuntimeCacheMockRecorder) GetPods added in v1.23.0

func (mr *MockRuntimeCacheMockRecorder) GetPods(arg0 interface{}) *gomock.Call

GetPods indicates an expected call of GetPods.

type MockRuntimeMockRecorder added in v1.23.0

type MockRuntimeMockRecorder struct {
	// contains filtered or unexported fields
}

MockRuntimeMockRecorder is the mock recorder for MockRuntime.

func (*MockRuntimeMockRecorder) APIVersion added in v1.23.0

func (mr *MockRuntimeMockRecorder) APIVersion() *gomock.Call

APIVersion indicates an expected call of APIVersion.

func (*MockRuntimeMockRecorder) CheckpointContainer added in v1.25.0

func (mr *MockRuntimeMockRecorder) CheckpointContainer(ctx, options interface{}) *gomock.Call

CheckpointContainer indicates an expected call of CheckpointContainer.

func (*MockRuntimeMockRecorder) DeleteContainer added in v1.23.0

func (mr *MockRuntimeMockRecorder) DeleteContainer(ctx, containerID interface{}) *gomock.Call

DeleteContainer indicates an expected call of DeleteContainer.

func (*MockRuntimeMockRecorder) GarbageCollect added in v1.23.0

func (mr *MockRuntimeMockRecorder) GarbageCollect(ctx, gcPolicy, allSourcesReady, evictNonDeletedPods interface{}) *gomock.Call

GarbageCollect indicates an expected call of GarbageCollect.

func (*MockRuntimeMockRecorder) GeneratePodStatus added in v1.26.0

func (mr *MockRuntimeMockRecorder) GeneratePodStatus(event interface{}) *gomock.Call

GeneratePodStatus indicates an expected call of GeneratePodStatus.

func (*MockRuntimeMockRecorder) GetContainerLogs added in v1.23.0

func (mr *MockRuntimeMockRecorder) GetContainerLogs(ctx, pod, containerID, logOptions, stdout, stderr interface{}) *gomock.Call

GetContainerLogs indicates an expected call of GetContainerLogs.

func (*MockRuntimeMockRecorder) GetImageRef added in v1.23.0

func (mr *MockRuntimeMockRecorder) GetImageRef(ctx, image interface{}) *gomock.Call

GetImageRef indicates an expected call of GetImageRef.

func (*MockRuntimeMockRecorder) GetImageSize added in v1.30.0

func (mr *MockRuntimeMockRecorder) GetImageSize(ctx, image interface{}) *gomock.Call

GetImageSize indicates an expected call of GetImageSize.

func (*MockRuntimeMockRecorder) GetPodStatus added in v1.23.0

func (mr *MockRuntimeMockRecorder) GetPodStatus(ctx, uid, name, namespace interface{}) *gomock.Call

GetPodStatus indicates an expected call of GetPodStatus.

func (*MockRuntimeMockRecorder) GetPods added in v1.23.0

func (mr *MockRuntimeMockRecorder) GetPods(ctx, all interface{}) *gomock.Call

GetPods indicates an expected call of GetPods.

func (*MockRuntimeMockRecorder) ImageFsInfo added in v1.29.0

func (mr *MockRuntimeMockRecorder) ImageFsInfo(ctx interface{}) *gomock.Call

ImageFsInfo indicates an expected call of ImageFsInfo.

func (*MockRuntimeMockRecorder) ImageStats added in v1.23.0

func (mr *MockRuntimeMockRecorder) ImageStats(ctx interface{}) *gomock.Call

ImageStats indicates an expected call of ImageStats.

func (*MockRuntimeMockRecorder) KillPod added in v1.23.0

func (mr *MockRuntimeMockRecorder) KillPod(ctx, pod, runningPod, gracePeriodOverride interface{}) *gomock.Call

KillPod indicates an expected call of KillPod.

func (*MockRuntimeMockRecorder) ListImages added in v1.23.0

func (mr *MockRuntimeMockRecorder) ListImages(ctx interface{}) *gomock.Call

ListImages indicates an expected call of ListImages.

func (*MockRuntimeMockRecorder) ListMetricDescriptors added in v1.26.0

func (mr *MockRuntimeMockRecorder) ListMetricDescriptors(ctx interface{}) *gomock.Call

ListMetricDescriptors indicates an expected call of ListMetricDescriptors.

func (*MockRuntimeMockRecorder) ListPodSandboxMetrics added in v1.26.0

func (mr *MockRuntimeMockRecorder) ListPodSandboxMetrics(ctx interface{}) *gomock.Call

ListPodSandboxMetrics indicates an expected call of ListPodSandboxMetrics.

func (*MockRuntimeMockRecorder) PullImage added in v1.23.0

func (mr *MockRuntimeMockRecorder) PullImage(ctx, image, pullSecrets, podSandboxConfig interface{}) *gomock.Call

PullImage indicates an expected call of PullImage.

func (*MockRuntimeMockRecorder) RemoveImage added in v1.23.0

func (mr *MockRuntimeMockRecorder) RemoveImage(ctx, image interface{}) *gomock.Call

RemoveImage indicates an expected call of RemoveImage.

func (*MockRuntimeMockRecorder) Status added in v1.23.0

func (mr *MockRuntimeMockRecorder) Status(ctx interface{}) *gomock.Call

Status indicates an expected call of Status.

func (*MockRuntimeMockRecorder) SyncPod added in v1.23.0

func (mr *MockRuntimeMockRecorder) SyncPod(ctx, pod, podStatus, pullSecrets, backOff interface{}) *gomock.Call

SyncPod indicates an expected call of SyncPod.

func (*MockRuntimeMockRecorder) Type added in v1.23.0

func (mr *MockRuntimeMockRecorder) Type() *gomock.Call

Type indicates an expected call of Type.

func (*MockRuntimeMockRecorder) UpdatePodCIDR added in v1.23.0

func (mr *MockRuntimeMockRecorder) UpdatePodCIDR(ctx, podCIDR interface{}) *gomock.Call

UpdatePodCIDR indicates an expected call of UpdatePodCIDR.

func (*MockRuntimeMockRecorder) Version added in v1.23.0

func (mr *MockRuntimeMockRecorder) Version(ctx interface{}) *gomock.Call

Version indicates an expected call of Version.

type MockStreamingRuntime added in v1.23.0

type MockStreamingRuntime struct {
	// contains filtered or unexported fields
}

MockStreamingRuntime is a mock of StreamingRuntime interface.

func NewMockStreamingRuntime added in v1.23.0

func NewMockStreamingRuntime(ctrl *gomock.Controller) *MockStreamingRuntime

NewMockStreamingRuntime creates a new mock instance.

func (*MockStreamingRuntime) EXPECT added in v1.23.0

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockStreamingRuntime) GetAttach added in v1.23.0

func (m *MockStreamingRuntime) GetAttach(ctx context.Context, id container.ContainerID, stdin, stdout, stderr, tty bool) (*url.URL, error)

GetAttach mocks base method.

func (*MockStreamingRuntime) GetExec added in v1.23.0

func (m *MockStreamingRuntime) GetExec(ctx context.Context, id container.ContainerID, cmd []string, stdin, stdout, stderr, tty bool) (*url.URL, error)

GetExec mocks base method.

func (*MockStreamingRuntime) GetPortForward added in v1.23.0

func (m *MockStreamingRuntime) GetPortForward(ctx context.Context, podName, podNamespace string, podUID types.UID, ports []int32) (*url.URL, error)

GetPortForward mocks base method.

type MockStreamingRuntimeMockRecorder added in v1.23.0

type MockStreamingRuntimeMockRecorder struct {
	// contains filtered or unexported fields
}

MockStreamingRuntimeMockRecorder is the mock recorder for MockStreamingRuntime.

func (*MockStreamingRuntimeMockRecorder) GetAttach added in v1.23.0

func (mr *MockStreamingRuntimeMockRecorder) GetAttach(ctx, id, stdin, stdout, stderr, tty interface{}) *gomock.Call

GetAttach indicates an expected call of GetAttach.

func (*MockStreamingRuntimeMockRecorder) GetExec added in v1.23.0

func (mr *MockStreamingRuntimeMockRecorder) GetExec(ctx, id, cmd, stdin, stdout, stderr, tty interface{}) *gomock.Call

GetExec indicates an expected call of GetExec.

func (*MockStreamingRuntimeMockRecorder) GetPortForward added in v1.23.0

func (mr *MockStreamingRuntimeMockRecorder) GetPortForward(ctx, podName, podNamespace, podUID, ports interface{}) *gomock.Call

GetPortForward indicates an expected call of GetPortForward.

type MockVersion added in v1.23.0

type MockVersion struct {
	// contains filtered or unexported fields
}

MockVersion is a mock of Version interface.

func NewMockVersion added in v1.23.0

func NewMockVersion(ctrl *gomock.Controller) *MockVersion

NewMockVersion creates a new mock instance.

func (*MockVersion) Compare added in v1.23.0

func (m *MockVersion) Compare(other string) (int, error)

Compare mocks base method.

func (*MockVersion) EXPECT added in v1.23.0

func (m *MockVersion) EXPECT() *MockVersionMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockVersion) String added in v1.23.0

func (m *MockVersion) String() string

String mocks base method.

type MockVersionMockRecorder added in v1.23.0

type MockVersionMockRecorder struct {
	// contains filtered or unexported fields
}

MockVersionMockRecorder is the mock recorder for MockVersion.

func (*MockVersionMockRecorder) Compare added in v1.23.0

func (mr *MockVersionMockRecorder) Compare(other interface{}) *gomock.Call

Compare indicates an expected call of Compare.

func (*MockVersionMockRecorder) String added in v1.23.0

func (mr *MockVersionMockRecorder) String() *gomock.Call

String indicates an expected call of String.

type MockpodsGetter added in v1.23.0

type MockpodsGetter struct {
	// contains filtered or unexported fields
}

MockpodsGetter is a mock of podsGetter interface.

func NewMockpodsGetter added in v1.23.0

func NewMockpodsGetter(ctrl *gomock.Controller) *MockpodsGetter

NewMockpodsGetter creates a new mock instance.

func (*MockpodsGetter) EXPECT added in v1.23.0

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockpodsGetter) GetPods added in v1.23.0

func (m *MockpodsGetter) GetPods(arg0 context.Context, arg1 bool) ([]*container.Pod, error)

GetPods mocks base method.

type MockpodsGetterMockRecorder added in v1.23.0

type MockpodsGetterMockRecorder struct {
	// contains filtered or unexported fields
}

MockpodsGetterMockRecorder is the mock recorder for MockpodsGetter.

func (*MockpodsGetterMockRecorder) GetPods added in v1.23.0

func (mr *MockpodsGetterMockRecorder) GetPods(arg0, arg1 interface{}) *gomock.Call

GetPods indicates an expected call of GetPods.

type TB added in v1.30.0

type TB interface {
	Errorf(format string, args ...any)
}

Jump to

Keyboard shortcuts

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