...

Package podman

Overview ▾

Package podman is a generated GoMock package.

Index ▾

func SplitLinesAsSet(s string) map[string]bool
type Capabilities
type Client
type HostInfo
type ListPodsContainer
type ListPodsReport
type MockClient
    func NewMockClient(ctrl *gomock.Controller) *MockClient
    func (m *MockClient) CleanupPodResources(pod *v1.Pod, cleanVolumes bool) error
    func (m *MockClient) EXPECT() *MockClientMockRecorder
    func (m *MockClient) ExecCMDInContainer(ctx context.Context, containerName, podName string, cmd []string, stdout, stderr io.Writer, stdin io.Reader, tty bool) error
    func (m *MockClient) GetAllPodsInNamespaceMatchingSelector(selector, ns string) (*v1.PodList, error)
    func (m *MockClient) GetAllResourcesFromSelector(selector, ns string) ([]unstructured.Unstructured, error)
    func (m *MockClient) GetCapabilities() (Capabilities, error)
    func (m *MockClient) GetPodLogs(podName, containerName string, followLog bool) (io.ReadCloser, error)
    func (m *MockClient) GetPodUsingComponentName(componentName string) (*v1.Pod, error)
    func (m *MockClient) GetPodsMatchingSelector(selector string) (*v1.PodList, error)
    func (m *MockClient) GetRunningPodFromSelector(selector string) (*v1.Pod, error)
    func (m *MockClient) KubeGenerate(name string) (*v1.Pod, error)
    func (m *MockClient) ListAllComponents() ([]api.ComponentAbstract, error)
    func (m *MockClient) PlayKube(pod *v1.Pod) error
    func (m *MockClient) PodLs() (map[string]bool, error)
    func (m *MockClient) PodRm(podname string) error
    func (m *MockClient) PodStop(podname string) error
    func (m *MockClient) PodWatcher(ctx context.Context, selector string) (watch.Interface, error)
    func (m *MockClient) Version(ctx context.Context) (SystemVersionReport, error)
    func (m *MockClient) VolumeLs() (map[string]bool, error)
    func (m *MockClient) VolumeRm(volumeName string) error
type MockClientMockRecorder
    func (mr *MockClientMockRecorder) CleanupPodResources(pod, cleanVolumes interface{}) *gomock.Call
    func (mr *MockClientMockRecorder) ExecCMDInContainer(ctx, containerName, podName, cmd, stdout, stderr, stdin, tty interface{}) *gomock.Call
    func (mr *MockClientMockRecorder) GetAllPodsInNamespaceMatchingSelector(selector, ns interface{}) *gomock.Call
    func (mr *MockClientMockRecorder) GetAllResourcesFromSelector(selector, ns interface{}) *gomock.Call
    func (mr *MockClientMockRecorder) GetCapabilities() *gomock.Call
    func (mr *MockClientMockRecorder) GetPodLogs(podName, containerName, followLog interface{}) *gomock.Call
    func (mr *MockClientMockRecorder) GetPodUsingComponentName(componentName interface{}) *gomock.Call
    func (mr *MockClientMockRecorder) GetPodsMatchingSelector(selector interface{}) *gomock.Call
    func (mr *MockClientMockRecorder) GetRunningPodFromSelector(selector interface{}) *gomock.Call
    func (mr *MockClientMockRecorder) KubeGenerate(name interface{}) *gomock.Call
    func (mr *MockClientMockRecorder) ListAllComponents() *gomock.Call
    func (mr *MockClientMockRecorder) PlayKube(pod interface{}) *gomock.Call
    func (mr *MockClientMockRecorder) PodLs() *gomock.Call
    func (mr *MockClientMockRecorder) PodRm(podname interface{}) *gomock.Call
    func (mr *MockClientMockRecorder) PodStop(podname interface{}) *gomock.Call
    func (mr *MockClientMockRecorder) PodWatcher(ctx, selector interface{}) *gomock.Call
    func (mr *MockClientMockRecorder) Version(ctx interface{}) *gomock.Call
    func (mr *MockClientMockRecorder) VolumeLs() *gomock.Call
    func (mr *MockClientMockRecorder) VolumeRm(volumeName interface{}) *gomock.Call
type PodInspectData
type PodmanCli
    func NewPodmanCli(ctx context.Context) (*PodmanCli, error)
    func (o *PodmanCli) CleanupPodResources(pod *corev1.Pod, cleanupVolumes bool) error
    func (o *PodmanCli) ExecCMDInContainer(ctx context.Context, containerName, podName string, cmd []string, stdout, stderr io.Writer, stdin io.Reader, tty bool) error
    func (o *PodmanCli) GetAllPodsInNamespaceMatchingSelector(selector string, ns string) (*corev1.PodList, error)
    func (o *PodmanCli) GetAllResourcesFromSelector(selector string, _ string) ([]unstructured.Unstructured, error)
    func (o *PodmanCli) GetCapabilities() (Capabilities, error)
    func (o *PodmanCli) GetPodLogs(podName, containerName string, followLog bool) (io.ReadCloser, error)
    func (o *PodmanCli) GetPodUsingComponentName(componentName string) (*corev1.Pod, error)
    func (o *PodmanCli) GetPodsMatchingSelector(selector string) (*corev1.PodList, error)
    func (o *PodmanCli) GetRunningPodFromSelector(selector string) (*corev1.Pod, error)
    func (o *PodmanCli) KubeGenerate(name string) (*corev1.Pod, error)
    func (o *PodmanCli) ListAllComponents() ([]api.ComponentAbstract, error)
    func (o *PodmanCli) PlayKube(pod *corev1.Pod) error
    func (o *PodmanCli) PodInspect(podname string) (PodInspectData, error)
    func (o *PodmanCli) PodLs() (map[string]bool, error)
    func (o *PodmanCli) PodRm(podname string) error
    func (o *PodmanCli) PodStop(podname string) error
    func (o *PodmanCli) PodWatcher(ctx context.Context, selector string) (watch.Interface, error)
    func (o *PodmanCli) Version(ctx context.Context) (SystemVersionReport, error)
    func (o *PodmanCli) VolumeLs() (map[string]bool, error)
    func (o *PodmanCli) VolumeRm(volumeName string) error
type PodmanNotFoundError
    func NewPodmanNotFoundError(err error) PodmanNotFoundError
    func (o PodmanNotFoundError) Error() string
type SystemVersionReport
type Version

Package files

capabilities.go component.go errors.go exec.go info.go inspect.go interface.go logs.go mock.go podman.go pods.go version.go

func SplitLinesAsSet

func SplitLinesAsSet(s string) map[string]bool

type Capabilities

type Capabilities struct {
    Cgroupv2 bool
}

type Client

type Client interface {
    platform.Client

    // PlayKube creates the Pod with Podman
    PlayKube(pod *corev1.Pod) error

    // KubeGenerate returns a Kubernetes Pod definition of an existing Pod
    KubeGenerate(name string) (*corev1.Pod, error)

    // PodStop stops the pod with given podname
    PodStop(podname string) error

    // PodRm deletes the pod with given podname
    PodRm(podname string) error

    // PodLs lists the names of existing pods
    PodLs() (map[string]bool, error)

    // VolumeLs lists the names of existing volumes
    VolumeLs() (map[string]bool, error)

    // VolumeRm deletes the volume with given volumeName
    VolumeRm(volumeName string) error

    // CleanupPodResources stops and removes a pod and its associated resources (volumes)
    CleanupPodResources(pod *corev1.Pod, cleanVolumes bool) error

    ListAllComponents() ([]api.ComponentAbstract, error)

    Version(ctx context.Context) (SystemVersionReport, error)

    // GetCapabilities returns the capabilities of the underlying system
    GetCapabilities() (Capabilities, error)
}

type HostInfo

type HostInfo struct {
    CgroupsVersion string `json:"cgroupVersion"`
}

type ListPodsContainer

type ListPodsContainer struct {
    Names string `json:"Names,omitempty"`
}

type ListPodsReport

ListPodsReport contains the result of the `podman pod ps --format json` command

type ListPodsReport struct {
    Name       string
    Labels     map[string]string
    Containers []ListPodsContainer `json:"Containers,omitempty"`
}

type MockClient

MockClient is a mock of Client interface.

type MockClient struct {
    // contains filtered or unexported fields
}

func NewMockClient

func NewMockClient(ctrl *gomock.Controller) *MockClient

NewMockClient creates a new mock instance.

func (*MockClient) CleanupPodResources

func (m *MockClient) CleanupPodResources(pod *v1.Pod, cleanVolumes bool) error

CleanupPodResources mocks base method.

func (*MockClient) EXPECT

func (m *MockClient) EXPECT() *MockClientMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockClient) ExecCMDInContainer

func (m *MockClient) ExecCMDInContainer(ctx context.Context, containerName, podName string, cmd []string, stdout, stderr io.Writer, stdin io.Reader, tty bool) error

ExecCMDInContainer mocks base method.

func (*MockClient) GetAllPodsInNamespaceMatchingSelector

func (m *MockClient) GetAllPodsInNamespaceMatchingSelector(selector, ns string) (*v1.PodList, error)

GetAllPodsInNamespaceMatchingSelector mocks base method.

func (*MockClient) GetAllResourcesFromSelector

func (m *MockClient) GetAllResourcesFromSelector(selector, ns string) ([]unstructured.Unstructured, error)

GetAllResourcesFromSelector mocks base method.

func (*MockClient) GetCapabilities

func (m *MockClient) GetCapabilities() (Capabilities, error)

GetCapabilities mocks base method.

func (*MockClient) GetPodLogs

func (m *MockClient) GetPodLogs(podName, containerName string, followLog bool) (io.ReadCloser, error)

GetPodLogs mocks base method.

func (*MockClient) GetPodUsingComponentName

func (m *MockClient) GetPodUsingComponentName(componentName string) (*v1.Pod, error)

GetPodUsingComponentName mocks base method.

func (*MockClient) GetPodsMatchingSelector

func (m *MockClient) GetPodsMatchingSelector(selector string) (*v1.PodList, error)

GetPodsMatchingSelector mocks base method.

func (*MockClient) GetRunningPodFromSelector

func (m *MockClient) GetRunningPodFromSelector(selector string) (*v1.Pod, error)

GetRunningPodFromSelector mocks base method.

func (*MockClient) KubeGenerate

func (m *MockClient) KubeGenerate(name string) (*v1.Pod, error)

KubeGenerate mocks base method.

func (*MockClient) ListAllComponents

func (m *MockClient) ListAllComponents() ([]api.ComponentAbstract, error)

ListAllComponents mocks base method.

func (*MockClient) PlayKube

func (m *MockClient) PlayKube(pod *v1.Pod) error

PlayKube mocks base method.

func (*MockClient) PodLs

func (m *MockClient) PodLs() (map[string]bool, error)

PodLs mocks base method.

func (*MockClient) PodRm

func (m *MockClient) PodRm(podname string) error

PodRm mocks base method.

func (*MockClient) PodStop

func (m *MockClient) PodStop(podname string) error

PodStop mocks base method.

func (*MockClient) PodWatcher

func (m *MockClient) PodWatcher(ctx context.Context, selector string) (watch.Interface, error)

PodWatcher mocks base method.

func (*MockClient) Version

func (m *MockClient) Version(ctx context.Context) (SystemVersionReport, error)

Version mocks base method.

func (*MockClient) VolumeLs

func (m *MockClient) VolumeLs() (map[string]bool, error)

VolumeLs mocks base method.

func (*MockClient) VolumeRm

func (m *MockClient) VolumeRm(volumeName string) error

VolumeRm mocks base method.

type MockClientMockRecorder

MockClientMockRecorder is the mock recorder for MockClient.

type MockClientMockRecorder struct {
    // contains filtered or unexported fields
}

func (*MockClientMockRecorder) CleanupPodResources

func (mr *MockClientMockRecorder) CleanupPodResources(pod, cleanVolumes interface{}) *gomock.Call

CleanupPodResources indicates an expected call of CleanupPodResources.

func (*MockClientMockRecorder) ExecCMDInContainer

func (mr *MockClientMockRecorder) ExecCMDInContainer(ctx, containerName, podName, cmd, stdout, stderr, stdin, tty interface{}) *gomock.Call

ExecCMDInContainer indicates an expected call of ExecCMDInContainer.

func (*MockClientMockRecorder) GetAllPodsInNamespaceMatchingSelector

func (mr *MockClientMockRecorder) GetAllPodsInNamespaceMatchingSelector(selector, ns interface{}) *gomock.Call

GetAllPodsInNamespaceMatchingSelector indicates an expected call of GetAllPodsInNamespaceMatchingSelector.

func (*MockClientMockRecorder) GetAllResourcesFromSelector

func (mr *MockClientMockRecorder) GetAllResourcesFromSelector(selector, ns interface{}) *gomock.Call

GetAllResourcesFromSelector indicates an expected call of GetAllResourcesFromSelector.

func (*MockClientMockRecorder) GetCapabilities

func (mr *MockClientMockRecorder) GetCapabilities() *gomock.Call

GetCapabilities indicates an expected call of GetCapabilities.

func (*MockClientMockRecorder) GetPodLogs

func (mr *MockClientMockRecorder) GetPodLogs(podName, containerName, followLog interface{}) *gomock.Call

GetPodLogs indicates an expected call of GetPodLogs.

func (*MockClientMockRecorder) GetPodUsingComponentName

func (mr *MockClientMockRecorder) GetPodUsingComponentName(componentName interface{}) *gomock.Call

GetPodUsingComponentName indicates an expected call of GetPodUsingComponentName.

func (*MockClientMockRecorder) GetPodsMatchingSelector

func (mr *MockClientMockRecorder) GetPodsMatchingSelector(selector interface{}) *gomock.Call

GetPodsMatchingSelector indicates an expected call of GetPodsMatchingSelector.

func (*MockClientMockRecorder) GetRunningPodFromSelector

func (mr *MockClientMockRecorder) GetRunningPodFromSelector(selector interface{}) *gomock.Call

GetRunningPodFromSelector indicates an expected call of GetRunningPodFromSelector.

func (*MockClientMockRecorder) KubeGenerate

func (mr *MockClientMockRecorder) KubeGenerate(name interface{}) *gomock.Call

KubeGenerate indicates an expected call of KubeGenerate.

func (*MockClientMockRecorder) ListAllComponents

func (mr *MockClientMockRecorder) ListAllComponents() *gomock.Call

ListAllComponents indicates an expected call of ListAllComponents.

func (*MockClientMockRecorder) PlayKube

func (mr *MockClientMockRecorder) PlayKube(pod interface{}) *gomock.Call

PlayKube indicates an expected call of PlayKube.

func (*MockClientMockRecorder) PodLs

func (mr *MockClientMockRecorder) PodLs() *gomock.Call

PodLs indicates an expected call of PodLs.

func (*MockClientMockRecorder) PodRm

func (mr *MockClientMockRecorder) PodRm(podname interface{}) *gomock.Call

PodRm indicates an expected call of PodRm.

func (*MockClientMockRecorder) PodStop

func (mr *MockClientMockRecorder) PodStop(podname interface{}) *gomock.Call

PodStop indicates an expected call of PodStop.

func (*MockClientMockRecorder) PodWatcher

func (mr *MockClientMockRecorder) PodWatcher(ctx, selector interface{}) *gomock.Call

PodWatcher indicates an expected call of PodWatcher.

func (*MockClientMockRecorder) Version

func (mr *MockClientMockRecorder) Version(ctx interface{}) *gomock.Call

Version indicates an expected call of Version.

func (*MockClientMockRecorder) VolumeLs

func (mr *MockClientMockRecorder) VolumeLs() *gomock.Call

VolumeLs indicates an expected call of VolumeLs.

func (*MockClientMockRecorder) VolumeRm

func (mr *MockClientMockRecorder) VolumeRm(volumeName interface{}) *gomock.Call

VolumeRm indicates an expected call of VolumeRm.

type PodInspectData

PodInspectData originates from From https://github.com/containers/podman/blob/main/libpod/define/pod_inspect.go

type PodInspectData struct {
    // ID is the ID of the pod.
    ID string `json:"Id"`
    // Name is the name of the pod.
    Name string
    // Namespace is the Libpod namespace the pod is placed in.
    Namespace string `json:"Namespace,omitempty"`
    // State represents the current state of the pod.
    State string `json:"State"`
    // Labels is a set of key-value labels that have been applied to the
    // pod.
    Labels map[string]string `json:"Labels,omitempty"`
}

type PodmanCli

type PodmanCli struct {
    // contains filtered or unexported fields
}

func NewPodmanCli

func NewPodmanCli(ctx context.Context) (*PodmanCli, error)

NewPodmanCli returns a new podman client, or nil if the podman command is not accessible in the system

func (*PodmanCli) CleanupPodResources

func (o *PodmanCli) CleanupPodResources(pod *corev1.Pod, cleanupVolumes bool) error

func (*PodmanCli) ExecCMDInContainer

func (o *PodmanCli) ExecCMDInContainer(ctx context.Context, containerName, podName string, cmd []string, stdout, stderr io.Writer, stdin io.Reader, tty bool) error

func (*PodmanCli) GetAllPodsInNamespaceMatchingSelector

func (o *PodmanCli) GetAllPodsInNamespaceMatchingSelector(selector string, ns string) (*corev1.PodList, error)

GetAllPodsInNamespaceMatchingSelector returns all pods matching the given label selector and in the specified namespace.

func (*PodmanCli) GetAllResourcesFromSelector

func (o *PodmanCli) GetAllResourcesFromSelector(selector string, _ string) ([]unstructured.Unstructured, error)

GetAllResourcesFromSelector returns all resources of any kind matching the given label selector.

func (*PodmanCli) GetCapabilities

func (o *PodmanCli) GetCapabilities() (Capabilities, error)

func (*PodmanCli) GetPodLogs

func (o *PodmanCli) GetPodLogs(podName, containerName string, followLog bool) (io.ReadCloser, error)

GetPodLogs returns the logs of the specified pod container. All logs for all containers part of the pod are returned if an empty string is provided as container name.

func (*PodmanCli) GetPodUsingComponentName

func (o *PodmanCli) GetPodUsingComponentName(componentName string) (*corev1.Pod, error)

func (*PodmanCli) GetPodsMatchingSelector

func (o *PodmanCli) GetPodsMatchingSelector(selector string) (*corev1.PodList, error)

GetPodsMatchingSelector returns all pods matching the given label selector.

func (*PodmanCli) GetRunningPodFromSelector

func (o *PodmanCli) GetRunningPodFromSelector(selector string) (*corev1.Pod, error)

GetRunningPodFromSelector returns any pod matching the given label selector. If multiple pods are found, implementations might have different behavior, by either returning an error or returning any element.

func (*PodmanCli) KubeGenerate

func (o *PodmanCli) KubeGenerate(name string) (*corev1.Pod, error)

func (*PodmanCli) ListAllComponents

func (o *PodmanCli) ListAllComponents() ([]api.ComponentAbstract, error)

func (*PodmanCli) PlayKube

func (o *PodmanCli) PlayKube(pod *corev1.Pod) error

func (*PodmanCli) PodInspect

func (o *PodmanCli) PodInspect(podname string) (PodInspectData, error)

func (*PodmanCli) PodLs

func (o *PodmanCli) PodLs() (map[string]bool, error)

func (*PodmanCli) PodRm

func (o *PodmanCli) PodRm(podname string) error

func (*PodmanCli) PodStop

func (o *PodmanCli) PodStop(podname string) error

func (*PodmanCli) PodWatcher

func (o *PodmanCli) PodWatcher(ctx context.Context, selector string) (watch.Interface, error)

func (*PodmanCli) Version

func (o *PodmanCli) Version(ctx context.Context) (SystemVersionReport, error)

Version returns the version of the Podman client.

func (*PodmanCli) VolumeLs

func (o *PodmanCli) VolumeLs() (map[string]bool, error)

func (*PodmanCli) VolumeRm

func (o *PodmanCli) VolumeRm(volumeName string) error

type PodmanNotFoundError

type PodmanNotFoundError struct {
    // contains filtered or unexported fields
}

func NewPodmanNotFoundError

func NewPodmanNotFoundError(err error) PodmanNotFoundError

func (PodmanNotFoundError) Error

func (o PodmanNotFoundError) Error() string

type SystemVersionReport

type SystemVersionReport struct {
    Client *Version `json:",omitempty"`
}

type Version

type Version struct {
    APIVersion string
    Version    string
    GoVersion  string
    GitCommit  string
    BuiltTime  string
    Built      int64
    OsArch     string
    Os         string
}