The dockerClient interface defines the subset of Docker API methods required by Ryuk to perform resource reaping. It abstracts the underlying Docker client to allow for easier testing and modularity. Implementations of this interface must provide methods for listing and removing containers, images, networks, and volumes, as well as basic connectivity checks like Ping and NegotiateAPIVersion.
type dockerClient interface {
ContainerList(ctx context.Context, options container.ListOptions) ([]container.Summary, error)
ContainerRemove(ctx context.Context, containerID string, options container.RemoveOptions) error
ImageList(ctx context.Context, options image.ListOptions) ([]image.Summary, error)
ImageRemove(ctx context.Context, imageID string, options image.RemoveOptions) ([]image.DeleteResponse, error)
NetworkList(ctx context.Context, options network.ListOptions) ([]network.Summary, error)
NetworkRemove(ctx context.Context, networkID string) error
VolumeList(ctx context.Context, options volume.ListOptions) (volume.ListResponse, error)
VolumeRemove(ctx context.Context, volumeID string, force bool) error
Ping(ctx context.Context) (types.Ping, error)
NegotiateAPIVersion(ctx context.Context)
}