Documentation ¶
Overview ¶
Package fakeclient contains a fake implementation of the containerd client for testing purposes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Container ¶
type Container struct { containerd.Container // contains filtered or unexported fields }
Container is a fake implementation of the containerd container object.
func NewFakeContainer ¶
NewFakeContainer creates a new fake instance of containerd container.
func (*Container) Info ¶
func (c *Container) Info(ctx context.Context, opts ...containerd.InfoOpts) (containers.Container, error)
Info returns the underlying container record type.
type CtrdClient ¶
type CtrdClient struct { plugin.CtrdClient // contains filtered or unexported fields }
CtrdClient is a fake implementation of CtrdClient for testing purposes.
func NewFakeCtrdClient ¶
func NewFakeCtrdClient(ctx context.Context, nssTaskIDs map[string][]string, tsks []*task.Process, ctrs []containerd.Container) (CtrdClient, error)
NewFakeCtrdClient creates a new fake containerd client.
func (*CtrdClient) Close ¶
func (c *CtrdClient) Close() error
Close is a no-op for the fake containerd client.
func (*CtrdClient) LoadContainer ¶
func (c *CtrdClient) LoadContainer(ctx context.Context, id string) (containerd.Container, error)
LoadContainer returns the containerd.Container object for the given task ID from ctrTasksIDs.
func (*CtrdClient) NamespaceService ¶
func (c *CtrdClient) NamespaceService() namespaces.Store
NamespaceService returns the fake namespaces service for testing purposes.
func (*CtrdClient) TaskService ¶
func (c *CtrdClient) TaskService() tasks.TasksClient
TaskService returns the fake task service for testing purposes.
type Image ¶
type Image struct { containerd.Image // contains filtered or unexported fields }
Image is a fake implementation of the containerd image object.
func NewFakeImage ¶
NewFakeImage creates a new fake instance of containerd image.
func (*Image) Target ¶
func (i *Image) Target() imagespecs.Descriptor
Target returns the image's target descriptor with the image's digest only.
type NamespacesService ¶
type NamespacesService struct { namespaces.Store // contains filtered or unexported fields }
NamespacesService is a fake implementation of the containerd namespaces service.
func NewFakeNamespacesService ¶
func NewFakeNamespacesService(namespaces []string) *NamespacesService
NewFakeNamespacesService creates a new fake namespaces service.
type Task ¶
type Task struct { containerd.Task // contains filtered or unexported fields }
Task is a fake implementation of the containerd task object.
func NewFakeTask ¶
NewFakeTask creates a new fake instance of containerd image.
type TasksService ¶
type TasksService struct { tasks.TasksClient // contains filtered or unexported fields }
TasksService is a fake implementation of the containerd tasks service.
func NewFakeTasksService ¶
func NewFakeTasksService(tasks []*task.Process, nssTaskIDs map[string][]string) *TasksService
NewFakeTasksService creates a new fake tasks service.
func (*TasksService) List ¶
func (s *TasksService) List(ctx context.Context, in *tasks.ListTasksRequest, opts ...grpc.CallOption) (*tasks.ListTasksResponse, error)
List returns a list of tasks for a namespace that is obtained from the context.