Documentation
¶
Index ¶
- func NewFakeCache(runtime container.Runtime) container.Cache
- func NewFakeRuntimeCache(getter podsGetter) RuntimeCache
- type FakeOS
- func (FakeOS) Chtimes(path string, atime time.Time, mtime time.Time) error
- func (FakeOS) Create(path string) (*os.File, error)
- func (f *FakeOS) Hostname() (name string, err error)
- func (FakeOS) MkdirAll(path string, perm os.FileMode) 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) Stat(path string) (os.FileInfo, error)
- func (FakeOS) Symlink(oldname string, newname string) error
- type FakePod
- type FakeRuntime
- func (f *FakeRuntime) APIVersion() (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) AttachContainer(containerID ContainerID, stdin io.Reader, stdout, stderr io.WriteCloser, ...) error
- func (f *FakeRuntime) ClearCalls()
- func (f *FakeRuntime) DeleteContainer(containerID ContainerID) error
- func (f *FakeRuntime) ExecInContainer(containerID ContainerID, cmd []string, stdin io.Reader, ...) error
- func (f *FakeRuntime) GarbageCollect(gcPolicy ContainerGCPolicy, ready bool) error
- func (f *FakeRuntime) GetContainerLogs(pod *api.Pod, containerID ContainerID, logOptions *api.PodLogOptions, ...) (err error)
- func (f *FakeRuntime) GetNetNS(containerID ContainerID) (string, error)
- func (f *FakeRuntime) GetPodContainerID(pod *Pod) (ContainerID, error)
- func (f *FakeRuntime) GetPodStatus(uid types.UID, name, namespace string) (*PodStatus, error)
- func (f *FakeRuntime) GetPods(all bool) ([]*Pod, error)
- func (f *FakeRuntime) ImageStats() (*ImageStats, error)
- func (f *FakeRuntime) IsImagePresent(image ImageSpec) (bool, error)
- func (f *FakeRuntime) KillContainerInPod(container api.Container, pod *api.Pod) error
- func (f *FakeRuntime) KillPod(pod *api.Pod, runningPod Pod, gracePeriodOverride *int64) error
- func (f *FakeRuntime) ListImages() ([]Image, error)
- func (f *FakeRuntime) PortForward(pod *Pod, port uint16, stream io.ReadWriteCloser) error
- func (f *FakeRuntime) PullImage(image ImageSpec, pullSecrets []api.Secret) error
- func (f *FakeRuntime) RemoveImage(image ImageSpec) error
- func (f *FakeRuntime) RunContainerInPod(container api.Container, pod *api.Pod, ...) error
- func (f *FakeRuntime) Status() error
- func (f *FakeRuntime) SyncPod(pod *api.Pod, _ api.PodStatus, _ *PodStatus, _ []api.Secret, ...) (result PodSyncResult)
- func (f *FakeRuntime) Type() string
- func (f *FakeRuntime) Version() (Version, error)
- type FakeRuntimeCache
- type FakeVersion
- type Mock
- func (r *Mock) APIVersion() (Version, error)
- func (r *Mock) AttachContainer(containerID ContainerID, stdin io.Reader, stdout, stderr io.WriteCloser, ...) error
- func (r *Mock) DeleteContainer(containerID ContainerID) error
- func (r *Mock) ExecInContainer(containerID ContainerID, cmd []string, stdin io.Reader, ...) error
- func (r *Mock) GarbageCollect(gcPolicy ContainerGCPolicy, ready bool) error
- func (r *Mock) GetContainerLogs(pod *api.Pod, containerID ContainerID, logOptions *api.PodLogOptions, ...) (err error)
- func (r *Mock) GetNetNS(containerID ContainerID) (string, error)
- func (r *Mock) GetPodContainerID(pod *Pod) (ContainerID, error)
- func (r *Mock) GetPodStatus(uid types.UID, name, namespace string) (*PodStatus, error)
- func (r *Mock) GetPods(all bool) ([]*Pod, error)
- func (r *Mock) ImageStats() (*ImageStats, error)
- func (r *Mock) IsImagePresent(image ImageSpec) (bool, error)
- func (r *Mock) KillContainerInPod(container api.Container, pod *api.Pod) error
- func (r *Mock) KillPod(pod *api.Pod, runningPod Pod, gracePeriodOverride *int64) error
- func (r *Mock) ListImages() ([]Image, error)
- func (r *Mock) PortForward(pod *Pod, port uint16, stream io.ReadWriteCloser) error
- func (r *Mock) PullImage(image ImageSpec, pullSecrets []api.Secret) error
- func (r *Mock) RemoveImage(image ImageSpec) error
- func (r *Mock) RunContainerInPod(container api.Container, pod *api.Pod, ...) error
- func (r *Mock) Start() error
- func (r *Mock) Status() error
- func (r *Mock) SyncPod(pod *api.Pod, apiStatus api.PodStatus, status *PodStatus, secrets []api.Secret, ...) PodSyncResult
- func (r *Mock) Type() string
- func (r *Mock) Version() (Version, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFakeCache ¶
func NewFakeCache(runtime container.Runtime) container.Cache
func NewFakeRuntimeCache ¶
func NewFakeRuntimeCache(getter podsGetter) RuntimeCache
Types ¶
type FakeOS ¶
type FakeOS struct {
StatFn func(string) (os.FileInfo, error)
ReadDirFn func(string) ([]os.FileInfo, error)
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) 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 (FakeOS) Create(path string) (*os.File, error)
Create is a fake call that returns nil.
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 (FakeOS) MkdirAll(path string, perm os.FileMode) error
Mkdir is a fake call that just returns 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.FileInfo, 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.
type FakeRuntime ¶
type FakeRuntime struct {
sync.Mutex
CalledFunctions []string
PodList []*FakePod
AllPodList []*FakePod
ImageList []Image
APIPodStatus api.PodStatus
PodStatus PodStatus
StartedPods []string
KilledPods []string
StartedContainers []string
KilledContainers []string
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() (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) AttachContainer ¶
func (f *FakeRuntime) AttachContainer(containerID ContainerID, stdin io.Reader, stdout, stderr io.WriteCloser, tty bool, resize <-chan term.Size) 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 ContainerID) error
func (*FakeRuntime) ExecInContainer ¶
func (f *FakeRuntime) ExecInContainer(containerID ContainerID, cmd []string, stdin io.Reader, stdout, stderr io.WriteCloser, tty bool, resize <-chan term.Size) error
func (*FakeRuntime) GarbageCollect ¶
func (f *FakeRuntime) GarbageCollect(gcPolicy ContainerGCPolicy, ready bool) error
func (*FakeRuntime) GetContainerLogs ¶
func (f *FakeRuntime) GetContainerLogs(pod *api.Pod, containerID ContainerID, logOptions *api.PodLogOptions, stdout, stderr io.Writer) (err error)
func (*FakeRuntime) GetNetNS ¶ added in v1.3.0
func (f *FakeRuntime) GetNetNS(containerID ContainerID) (string, error)
func (*FakeRuntime) GetPodContainerID ¶ added in v1.3.0
func (f *FakeRuntime) GetPodContainerID(pod *Pod) (ContainerID, error)
func (*FakeRuntime) GetPodStatus ¶
func (f *FakeRuntime) GetPodStatus(uid types.UID, name, namespace string) (*PodStatus, error)
func (*FakeRuntime) ImageStats ¶ added in v1.3.0
func (f *FakeRuntime) ImageStats() (*ImageStats, error)
func (*FakeRuntime) IsImagePresent ¶
func (f *FakeRuntime) IsImagePresent(image ImageSpec) (bool, error)
func (*FakeRuntime) KillContainerInPod ¶
func (f *FakeRuntime) KillContainerInPod(container api.Container, pod *api.Pod) error
func (*FakeRuntime) KillPod ¶
func (f *FakeRuntime) KillPod(pod *api.Pod, runningPod Pod, gracePeriodOverride *int64) error
func (*FakeRuntime) ListImages ¶
func (f *FakeRuntime) ListImages() ([]Image, error)
func (*FakeRuntime) PortForward ¶
func (f *FakeRuntime) PortForward(pod *Pod, port uint16, stream io.ReadWriteCloser) error
func (*FakeRuntime) PullImage ¶
func (f *FakeRuntime) PullImage(image ImageSpec, pullSecrets []api.Secret) error
func (*FakeRuntime) RemoveImage ¶
func (f *FakeRuntime) RemoveImage(image ImageSpec) error
func (*FakeRuntime) RunContainerInPod ¶
func (f *FakeRuntime) RunContainerInPod(container api.Container, pod *api.Pod, volumeMap map[string]volume.VolumePlugin) error
type FakeRuntimeCache ¶
type FakeRuntimeCache struct {
// contains filtered or unexported fields
}
func (*FakeRuntimeCache) ForceUpdateIfOlder ¶
func (f *FakeRuntimeCache) ForceUpdateIfOlder(time.Time) error
type FakeVersion ¶
type FakeVersion struct {
Version string
}
type Mock ¶
type Mock struct {
mock.Mock
}
func (*Mock) APIVersion ¶
func (r *Mock) APIVersion() (Version, error)
func (*Mock) AttachContainer ¶
func (r *Mock) AttachContainer(containerID ContainerID, stdin io.Reader, stdout, stderr io.WriteCloser, tty bool, resize <-chan term.Size) error
func (*Mock) DeleteContainer ¶ added in v1.4.0
func (r *Mock) DeleteContainer(containerID ContainerID) error
func (*Mock) ExecInContainer ¶
func (r *Mock) ExecInContainer(containerID ContainerID, cmd []string, stdin io.Reader, stdout, stderr io.WriteCloser, tty bool, resize <-chan term.Size) error
func (*Mock) GarbageCollect ¶
func (r *Mock) GarbageCollect(gcPolicy ContainerGCPolicy, ready bool) error
func (*Mock) GetContainerLogs ¶
func (r *Mock) GetContainerLogs(pod *api.Pod, containerID ContainerID, logOptions *api.PodLogOptions, stdout, stderr io.Writer) (err error)
func (*Mock) GetNetNS ¶ added in v1.3.0
func (r *Mock) GetNetNS(containerID ContainerID) (string, error)
func (*Mock) GetPodContainerID ¶ added in v1.3.0
func (r *Mock) GetPodContainerID(pod *Pod) (ContainerID, error)
func (*Mock) GetPodStatus ¶
func (r *Mock) GetPodStatus(uid types.UID, name, namespace string) (*PodStatus, error)
func (*Mock) ImageStats ¶ added in v1.3.0
func (r *Mock) ImageStats() (*ImageStats, error)
func (*Mock) IsImagePresent ¶
func (r *Mock) IsImagePresent(image ImageSpec) (bool, error)
func (*Mock) KillContainerInPod ¶
func (r *Mock) KillContainerInPod(container api.Container, pod *api.Pod) error
func (*Mock) KillPod ¶
func (r *Mock) KillPod(pod *api.Pod, runningPod Pod, gracePeriodOverride *int64) error
func (*Mock) ListImages ¶
func (r *Mock) ListImages() ([]Image, error)
func (*Mock) PortForward ¶
func (r *Mock) PortForward(pod *Pod, port uint16, stream io.ReadWriteCloser) error
func (*Mock) RemoveImage ¶
func (r *Mock) RemoveImage(image ImageSpec) error
func (*Mock) RunContainerInPod ¶
func (r *Mock) RunContainerInPod(container api.Container, pod *api.Pod, volumeMap map[string]volume.VolumePlugin) error
Click to show internal directories.
Click to hide internal directories.