Documentation ¶
Overview ¶
Code generated by mockery v1.0.0
Index ¶
- Constants
- func NewFakeCache(runtime container.Runtime) container.Cache
- func NewFakeRuntimeCache(getter podsGetter) kubecontainer.RuntimeCache
- type FakeContainerCommandRunner
- type FakeOS
- func (FakeOS) Chmod(path string, perm os.FileMode) error
- func (FakeOS) Chtimes(path string, atime time.Time, mtime time.Time) error
- func (f *FakeOS) Create(path string) (*os.File, error)
- func (f *FakeOS) Glob(pattern string) ([]string, error)
- func (f *FakeOS) Hostname() (name string, err error)
- func (f *FakeOS) MkdirAll(path string, perm os.FileMode) error
- func (FakeOS) Open(name string) (*os.File, error)
- func (FakeOS) OpenFile(name string, flag int, perm os.FileMode) (*os.File, error)
- func (FakeOS) Pipe() (r *os.File, w *os.File, err error)
- func (f *FakeOS) ReadDir(dirname string) ([]os.FileInfo, error)
- func (f *FakeOS) Remove(path string) error
- func (f *FakeOS) RemoveAll(path string) error
- func (FakeOS) Rename(oldpath, newpath string) error
- func (f FakeOS) Stat(path string) (os.FileInfo, error)
- func (f *FakeOS) Symlink(oldname string, newname string) error
- type FakePod
- type FakeRuntime
- func (f *FakeRuntime) APIVersion() (kubecontainer.Version, error)
- func (f *FakeRuntime) AssertCalls(calls []string) error
- func (f *FakeRuntime) AssertKilledContainers(containers []string) error
- func (f *FakeRuntime) AssertKilledPods(pods []string) error
- func (f *FakeRuntime) AssertStartedContainers(containers []string) error
- func (f *FakeRuntime) AssertStartedPods(pods []string) error
- func (f *FakeRuntime) ClearCalls()
- func (f *FakeRuntime) DeleteContainer(containerID kubecontainer.ContainerID) error
- func (f *FakeRuntime) GarbageCollect(gcPolicy kubecontainer.GCPolicy, ready bool, evictNonDeletedPods bool) error
- func (f *FakeRuntime) GetContainerLogs(_ context.Context, pod *v1.Pod, containerID kubecontainer.ContainerID, ...) (err error)
- func (f *FakeRuntime) GetImageRef(image kubecontainer.ImageSpec) (string, error)
- func (f *FakeRuntime) GetPodStatus(uid types.UID, name, namespace string) (*kubecontainer.PodStatus, error)
- func (f *FakeRuntime) GetPods(all bool) ([]*kubecontainer.Pod, error)
- func (f *FakeRuntime) ImageStats() (*kubecontainer.ImageStats, error)
- func (f *FakeRuntime) KillContainerInPod(container v1.Container, pod *v1.Pod) error
- func (f *FakeRuntime) KillPod(pod *v1.Pod, runningPod kubecontainer.Pod, gracePeriodOverride *int64) error
- func (f *FakeRuntime) ListImages() ([]kubecontainer.Image, error)
- func (f *FakeRuntime) PullImage(image kubecontainer.ImageSpec, pullSecrets []v1.Secret, ...) (string, error)
- func (f *FakeRuntime) RemoveImage(image kubecontainer.ImageSpec) error
- func (f *FakeRuntime) RunContainerInPod(container v1.Container, pod *v1.Pod, volumeMap map[string]volume.VolumePlugin) error
- func (f *FakeRuntime) Status() (*kubecontainer.RuntimeStatus, error)
- func (f *FakeRuntime) SupportsSingleFileMapping() bool
- func (f *FakeRuntime) SyncPod(pod *v1.Pod, _ *kubecontainer.PodStatus, _ []v1.Secret, ...) (result kubecontainer.PodSyncResult)
- func (f *FakeRuntime) Type() string
- func (f *FakeRuntime) UpdatePodCIDR(c string) error
- func (f *FakeRuntime) Version() (kubecontainer.Version, error)
- type FakeRuntimeCache
- type FakeRuntimeHelper
- func (f *FakeRuntimeHelper) GeneratePodHostNameAndDomain(pod *v1.Pod) (string, string, error)
- func (f *FakeRuntimeHelper) GenerateRunContainerOptions(pod *v1.Pod, container *v1.Container, podIP string, podIPs []string) (*kubecontainer.RunContainerOptions, func(), error)
- func (f *FakeRuntimeHelper) GetExtraSupplementalGroupsForPod(pod *v1.Pod) []int64
- func (f *FakeRuntimeHelper) GetPodCgroupParent(pod *v1.Pod) string
- func (f *FakeRuntimeHelper) GetPodDNS(pod *v1.Pod) (*runtimeapi.DNSConfig, error)
- func (f *FakeRuntimeHelper) GetPodDir(podUID kubetypes.UID) string
- type FakeStreamingRuntime
- func (f *FakeStreamingRuntime) GetAttach(id kubecontainer.ContainerID, stdin, stdout, stderr, tty bool) (*url.URL, error)
- func (f *FakeStreamingRuntime) GetExec(id kubecontainer.ContainerID, cmd []string, stdin, stdout, stderr, tty bool) (*url.URL, error)
- func (f *FakeStreamingRuntime) GetPortForward(podName, podNamespace string, podUID types.UID, ports []int32) (*url.URL, error)
- type FakeVersion
- type Mock
- func (r *Mock) APIVersion() (kubecontainer.Version, error)
- func (r *Mock) AttachContainer(containerID kubecontainer.ContainerID, stdin io.Reader, ...) error
- func (r *Mock) DeleteContainer(containerID kubecontainer.ContainerID) error
- func (r *Mock) ExecInContainer(containerID kubecontainer.ContainerID, cmd []string, stdin io.Reader, ...) error
- func (r *Mock) GarbageCollect(gcPolicy kubecontainer.GCPolicy, ready bool, evictNonDeletedPods bool) error
- func (r *Mock) GetContainerLogs(_ context.Context, pod *v1.Pod, containerID kubecontainer.ContainerID, ...) (err error)
- func (r *Mock) GetImageRef(image kubecontainer.ImageSpec) (string, error)
- func (r *Mock) GetPodStatus(uid types.UID, name, namespace string) (*kubecontainer.PodStatus, error)
- func (r *Mock) GetPods(all bool) ([]*kubecontainer.Pod, error)
- func (r *Mock) ImageStats() (*kubecontainer.ImageStats, error)
- func (r *Mock) KillContainerInPod(container v1.Container, pod *v1.Pod) error
- func (r *Mock) KillPod(pod *v1.Pod, runningPod kubecontainer.Pod, gracePeriodOverride *int64) error
- func (r *Mock) ListImages() ([]kubecontainer.Image, error)
- func (r *Mock) PortForward(pod *kubecontainer.Pod, port uint16, stream io.ReadWriteCloser) error
- func (r *Mock) PullImage(image kubecontainer.ImageSpec, pullSecrets []v1.Secret, ...) (string, error)
- func (r *Mock) RemoveImage(image kubecontainer.ImageSpec) error
- func (r *Mock) RunContainerInPod(container v1.Container, pod *v1.Pod, volumeMap map[string]volume.VolumePlugin) error
- func (r *Mock) Start() error
- func (r *Mock) Status() (*kubecontainer.RuntimeStatus, error)
- func (r *Mock) SupportsSingleFileMapping() bool
- func (r *Mock) SyncPod(pod *v1.Pod, status *kubecontainer.PodStatus, secrets []v1.Secret, ...) kubecontainer.PodSyncResult
- func (r *Mock) Type() string
- func (r *Mock) UpdatePodCIDR(c string) error
- func (r *Mock) Version() (kubecontainer.Version, error)
- type MockFileInfo
- type MockRuntimeCache
Constants ¶
const FakeHost = "localhost:12345"
Variables ¶
This section is empty.
Functions ¶
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(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.FileInfo, 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 }
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) Create ¶ added in v1.3.0
Create is a fake call that creates a virtual file and returns nil.
func (*FakeOS) Glob ¶ added in v1.5.0
Glob is a fake call that returns list of virtual files matching a pattern.
func (*FakeOS) ReadDir ¶ added in v1.3.0
ReadDir is a fake call that returns the files under the directory.
type FakePod ¶ added in v1.3.0
type FakePod struct { Pod *kubecontainer.Pod NetnsPath string }
type FakeRuntime ¶
type FakeRuntime struct { sync.Mutex CalledFunctions []string PodList []*FakePod AllPodList []*FakePod ImageList []kubecontainer.Image 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 }
FakeRuntime is a fake container runtime for testing.
func (*FakeRuntime) APIVersion ¶
func (f *FakeRuntime) APIVersion() (kubecontainer.Version, error)
func (*FakeRuntime) AssertCalls ¶
func (f *FakeRuntime) AssertCalls(calls []string) error
AssertCalls test if the invoked functions are as expected.
func (*FakeRuntime) AssertKilledContainers ¶
func (f *FakeRuntime) AssertKilledContainers(containers []string) error
func (*FakeRuntime) AssertKilledPods ¶
func (f *FakeRuntime) AssertKilledPods(pods []string) error
func (*FakeRuntime) AssertStartedContainers ¶
func (f *FakeRuntime) AssertStartedContainers(containers []string) error
func (*FakeRuntime) AssertStartedPods ¶
func (f *FakeRuntime) AssertStartedPods(pods []string) error
func (*FakeRuntime) ClearCalls ¶
func (f *FakeRuntime) ClearCalls()
ClearCalls resets the FakeRuntime to the initial state.
func (*FakeRuntime) DeleteContainer ¶ added in v1.4.0
func (f *FakeRuntime) DeleteContainer(containerID kubecontainer.ContainerID) error
func (*FakeRuntime) GarbageCollect ¶
func (f *FakeRuntime) GarbageCollect(gcPolicy kubecontainer.GCPolicy, ready bool, evictNonDeletedPods bool) 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(image kubecontainer.ImageSpec) (string, error)
func (*FakeRuntime) GetPodStatus ¶
func (f *FakeRuntime) GetPodStatus(uid types.UID, name, namespace string) (*kubecontainer.PodStatus, error)
func (*FakeRuntime) GetPods ¶
func (f *FakeRuntime) GetPods(all bool) ([]*kubecontainer.Pod, error)
func (*FakeRuntime) ImageStats ¶ added in v1.3.0
func (f *FakeRuntime) ImageStats() (*kubecontainer.ImageStats, error)
func (*FakeRuntime) KillContainerInPod ¶
func (*FakeRuntime) KillPod ¶
func (f *FakeRuntime) KillPod(pod *v1.Pod, runningPod kubecontainer.Pod, gracePeriodOverride *int64) error
func (*FakeRuntime) ListImages ¶
func (f *FakeRuntime) ListImages() ([]kubecontainer.Image, error)
func (*FakeRuntime) PullImage ¶
func (f *FakeRuntime) PullImage(image kubecontainer.ImageSpec, pullSecrets []v1.Secret, podSandboxConfig *runtimeapi.PodSandboxConfig) (string, error)
func (*FakeRuntime) RemoveImage ¶
func (f *FakeRuntime) RemoveImage(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) Status ¶
func (f *FakeRuntime) Status() (*kubecontainer.RuntimeStatus, error)
func (*FakeRuntime) SupportsSingleFileMapping ¶ added in v1.17.0
func (f *FakeRuntime) SupportsSingleFileMapping() bool
func (*FakeRuntime) SyncPod ¶
func (f *FakeRuntime) SyncPod(pod *v1.Pod, _ *kubecontainer.PodStatus, _ []v1.Secret, backOff *flowcontrol.Backoff) (result kubecontainer.PodSyncResult)
func (*FakeRuntime) Type ¶
func (f *FakeRuntime) Type() string
func (*FakeRuntime) UpdatePodCIDR ¶ added in v1.5.0
func (f *FakeRuntime) UpdatePodCIDR(c string) error
UpdatePodCIDR fulfills the cri interface.
func (*FakeRuntime) Version ¶
func (f *FakeRuntime) Version() (kubecontainer.Version, error)
type FakeRuntimeCache ¶
type FakeRuntimeCache struct {
// contains filtered or unexported fields
}
func (*FakeRuntimeCache) ForceUpdateIfOlder ¶
func (f *FakeRuntimeCache) ForceUpdateIfOlder(time.Time) error
func (*FakeRuntimeCache) GetPods ¶
func (f *FakeRuntimeCache) GetPods() ([]*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
This is not used by docker runtime.
func (*FakeRuntimeHelper) GenerateRunContainerOptions ¶ added in v1.6.0
func (f *FakeRuntimeHelper) GenerateRunContainerOptions(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) 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)
type FakeStreamingRuntime ¶ added in v1.11.0
type FakeStreamingRuntime struct {
*FakeRuntime
}
func (*FakeStreamingRuntime) GetAttach ¶ added in v1.11.0
func (f *FakeStreamingRuntime) GetAttach(id kubecontainer.ContainerID, stdin, stdout, stderr, tty bool) (*url.URL, error)
func (*FakeStreamingRuntime) GetExec ¶ added in v1.11.0
func (f *FakeStreamingRuntime) GetExec(id kubecontainer.ContainerID, cmd []string, stdin, stdout, stderr, tty bool) (*url.URL, error)
func (*FakeStreamingRuntime) GetPortForward ¶ added in v1.11.0
type FakeVersion ¶
type FakeVersion struct {
Version string
}
func (*FakeVersion) String ¶
func (fv *FakeVersion) String() string
type Mock ¶
func (*Mock) APIVersion ¶
func (r *Mock) APIVersion() (kubecontainer.Version, error)
func (*Mock) AttachContainer ¶
func (r *Mock) AttachContainer(containerID kubecontainer.ContainerID, stdin io.Reader, stdout, stderr io.WriteCloser, tty bool, resize <-chan remotecommand.TerminalSize) error
func (*Mock) DeleteContainer ¶ added in v1.4.0
func (r *Mock) DeleteContainer(containerID kubecontainer.ContainerID) error
func (*Mock) ExecInContainer ¶
func (r *Mock) ExecInContainer(containerID kubecontainer.ContainerID, cmd []string, stdin io.Reader, stdout, stderr io.WriteCloser, tty bool, resize <-chan remotecommand.TerminalSize, timeout time.Duration) error
func (*Mock) GarbageCollect ¶
func (*Mock) GetContainerLogs ¶
func (r *Mock) GetContainerLogs(_ context.Context, pod *v1.Pod, containerID kubecontainer.ContainerID, logOptions *v1.PodLogOptions, stdout, stderr io.Writer) (err error)
func (*Mock) GetImageRef ¶ added in v1.6.0
func (r *Mock) GetImageRef(image kubecontainer.ImageSpec) (string, error)
func (*Mock) GetPodStatus ¶
func (*Mock) ImageStats ¶ added in v1.3.0
func (r *Mock) ImageStats() (*kubecontainer.ImageStats, error)
func (*Mock) KillContainerInPod ¶
func (*Mock) ListImages ¶
func (r *Mock) ListImages() ([]kubecontainer.Image, error)
func (*Mock) PortForward ¶
func (r *Mock) PortForward(pod *kubecontainer.Pod, port uint16, stream io.ReadWriteCloser) error
func (*Mock) PullImage ¶
func (r *Mock) PullImage(image kubecontainer.ImageSpec, pullSecrets []v1.Secret, podSandboxConfig *runtimeapi.PodSandboxConfig) (string, error)
func (*Mock) RemoveImage ¶
func (r *Mock) RemoveImage(image kubecontainer.ImageSpec) error
func (*Mock) RunContainerInPod ¶
func (*Mock) Status ¶
func (r *Mock) Status() (*kubecontainer.RuntimeStatus, error)
func (*Mock) SupportsSingleFileMapping ¶ added in v1.17.0
func (*Mock) SyncPod ¶
func (r *Mock) SyncPod(pod *v1.Pod, status *kubecontainer.PodStatus, secrets []v1.Secret, backOff *flowcontrol.Backoff) kubecontainer.PodSyncResult
func (*Mock) UpdatePodCIDR ¶ added in v1.5.0
UpdatePodCIDR fulfills the cri interface.
type MockFileInfo ¶ added in v1.5.0
type MockFileInfo struct {
// contains filtered or unexported fields
}
Mock of FileInfo interface
func NewMockFileInfo ¶ added in v1.5.0
func NewMockFileInfo(ctrl *gomock.Controller) *MockFileInfo
func (*MockFileInfo) EXPECT ¶ added in v1.5.0
func (_m *MockFileInfo) EXPECT() *_MockFileInfoRecorder
func (*MockFileInfo) IsDir ¶ added in v1.5.0
func (_m *MockFileInfo) IsDir() bool
func (*MockFileInfo) ModTime ¶ added in v1.5.0
func (_m *MockFileInfo) ModTime() time.Time
func (*MockFileInfo) Mode ¶ added in v1.5.0
func (_m *MockFileInfo) Mode() os.FileMode
func (*MockFileInfo) Name ¶ added in v1.5.0
func (_m *MockFileInfo) Name() string
func (*MockFileInfo) Size ¶ added in v1.5.0
func (_m *MockFileInfo) Size() int64
func (*MockFileInfo) Sys ¶ added in v1.5.0
func (_m *MockFileInfo) Sys() interface{}
type MockRuntimeCache ¶ added in v1.8.0
MockRuntimeCache is an autogenerated mock type for the RuntimeCache type
func (*MockRuntimeCache) ForceUpdateIfOlder ¶ added in v1.8.0
func (_m *MockRuntimeCache) ForceUpdateIfOlder(_a0 time.Time) error
ForceUpdateIfOlder provides a mock function with given fields: _a0