func (m *MockDockerClient) InspectContainer(id string) (*docker.Container, error) {
	container := &docker.Container{}
	err := m.Ping()
	if err != nil {
		return container, err
	}
	podContainer, exists := m.podByContainer[id]
	if !exists {
		return container, errors.New("no such container")
	}
	container.ID = id
	container.State = docker.State{Pid: podContainer.pid}
	return container, nil
}
InspectContainer returns information about a container by its ID.
package dockerclient
import (
	"github.com/fsouza/go-dockerclient"
	"errors"
	"github.com/contiv/vpp/plugins/ksr/model/pod"
)
const (
	k8sLabelForPodName      = "io.kubernetes.pod.name"
	k8sLabelForPodNamespace = "io.kubernetes.pod.namespace"
)
type MockDockerClient struct {
	connected      bool
	podByID        map[pod.ID]podContainer
	podByContainer map[string]podContainer
}
type podContainer struct {
	podID       pod.ID
	containerID string
	pid         int
}
func NewMockDockerClient() *MockDockerClient {
	return &MockDockerClient{
		podByID:        make(map[pod.ID]podContainer),
		podByContainer: make(map[string]podContainer),
	}
}
func (m *MockDockerClient) Connect() {
	m.connected = true
}
func (m *MockDockerClient) Disconnect() {
	m.connected = false
}
func (m *MockDockerClient) AddPod(podID pod.ID, container string, pid int) {
	podContainer := podContainer{
		podID:       podID,
		containerID: container,
		pid:         pid,
	}
	m.podByID[podID] = podContainer
	m.podByContainer[container] = podContainer
}
func (m *MockDockerClient) DelPod(podID pod.ID) {
	podContainer, exists := m.podByID[podID]
	if exists {
		delete(m.podByID, podID)
		delete(m.podByContainer, podContainer.containerID)
	}
}
func (m *MockDockerClient) Ping() error {
	if !m.connected {
		return errors.New("docker client is not connected")
	}
	return nil
}
func (m *MockDockerClient) ListContainers(opts docker.ListContainersOptions) (containers []docker.APIContainers, err error) {
	err = m.Ping()
	if err != nil {
		return containers, err
	}
	for _, container := range m.podByID {
		containers = append(containers, docker.APIContainers{
			ID: container.containerID,
			Labels: map[string]string{
				k8sLabelForPodName:      container.podID.Name,
				k8sLabelForPodNamespace: container.podID.Namespace,
			},
		})
	}
	return containers, nil
}