func SplitLinesAsSet(s string) map[string]bool
type Capabilities struct { Cgroupv2 bool }
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 struct { CgroupsVersion string `json:"cgroupVersion"` }
type ListPodsContainer struct { Names string `json:"Names,omitempty"` }
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"` }
MockClient is a mock of Client interface.
type MockClient struct {
// contains filtered or unexported fields
}
func NewMockClient(ctrl *gomock.Controller) *MockClient
NewMockClient creates a new mock instance.
func (m *MockClient) CleanupPodResources(pod *v1.Pod, cleanVolumes bool) error
CleanupPodResources mocks base method.
func (m *MockClient) EXPECT() *MockClientMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
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 (m *MockClient) GetAllPodsInNamespaceMatchingSelector(selector, ns string) (*v1.PodList, error)
GetAllPodsInNamespaceMatchingSelector mocks base method.
func (m *MockClient) GetAllResourcesFromSelector(selector, ns string) ([]unstructured.Unstructured, error)
GetAllResourcesFromSelector mocks base method.
func (m *MockClient) GetCapabilities() (Capabilities, error)
GetCapabilities mocks base method.
func (m *MockClient) GetPodLogs(podName, containerName string, followLog bool) (io.ReadCloser, error)
GetPodLogs mocks base method.
func (m *MockClient) GetPodUsingComponentName(componentName string) (*v1.Pod, error)
GetPodUsingComponentName mocks base method.
func (m *MockClient) GetPodsMatchingSelector(selector string) (*v1.PodList, error)
GetPodsMatchingSelector mocks base method.
func (m *MockClient) GetRunningPodFromSelector(selector string) (*v1.Pod, error)
GetRunningPodFromSelector mocks base method.
func (m *MockClient) KubeGenerate(name string) (*v1.Pod, error)
KubeGenerate mocks base method.
func (m *MockClient) ListAllComponents() ([]api.ComponentAbstract, error)
ListAllComponents mocks base method.
func (m *MockClient) PlayKube(pod *v1.Pod) error
PlayKube mocks base method.
func (m *MockClient) PodLs() (map[string]bool, error)
PodLs mocks base method.
func (m *MockClient) PodRm(podname string) error
PodRm mocks base method.
func (m *MockClient) PodStop(podname string) error
PodStop mocks base method.
func (m *MockClient) PodWatcher(ctx context.Context, selector string) (watch.Interface, error)
PodWatcher mocks base method.
func (m *MockClient) Version(ctx context.Context) (SystemVersionReport, error)
Version mocks base method.
func (m *MockClient) VolumeLs() (map[string]bool, error)
VolumeLs mocks base method.
func (m *MockClient) VolumeRm(volumeName string) error
VolumeRm mocks base method.
MockClientMockRecorder is the mock recorder for MockClient.
type MockClientMockRecorder struct {
// contains filtered or unexported fields
}
func (mr *MockClientMockRecorder) CleanupPodResources(pod, cleanVolumes interface{}) *gomock.Call
CleanupPodResources indicates an expected call of CleanupPodResources.
func (mr *MockClientMockRecorder) ExecCMDInContainer(ctx, containerName, podName, cmd, stdout, stderr, stdin, tty interface{}) *gomock.Call
ExecCMDInContainer indicates an expected call of ExecCMDInContainer.
func (mr *MockClientMockRecorder) GetAllPodsInNamespaceMatchingSelector(selector, ns interface{}) *gomock.Call
GetAllPodsInNamespaceMatchingSelector indicates an expected call of GetAllPodsInNamespaceMatchingSelector.
func (mr *MockClientMockRecorder) GetAllResourcesFromSelector(selector, ns interface{}) *gomock.Call
GetAllResourcesFromSelector indicates an expected call of GetAllResourcesFromSelector.
func (mr *MockClientMockRecorder) GetCapabilities() *gomock.Call
GetCapabilities indicates an expected call of GetCapabilities.
func (mr *MockClientMockRecorder) GetPodLogs(podName, containerName, followLog interface{}) *gomock.Call
GetPodLogs indicates an expected call of GetPodLogs.
func (mr *MockClientMockRecorder) GetPodUsingComponentName(componentName interface{}) *gomock.Call
GetPodUsingComponentName indicates an expected call of GetPodUsingComponentName.
func (mr *MockClientMockRecorder) GetPodsMatchingSelector(selector interface{}) *gomock.Call
GetPodsMatchingSelector indicates an expected call of GetPodsMatchingSelector.
func (mr *MockClientMockRecorder) GetRunningPodFromSelector(selector interface{}) *gomock.Call
GetRunningPodFromSelector indicates an expected call of GetRunningPodFromSelector.
func (mr *MockClientMockRecorder) KubeGenerate(name interface{}) *gomock.Call
KubeGenerate indicates an expected call of KubeGenerate.
func (mr *MockClientMockRecorder) ListAllComponents() *gomock.Call
ListAllComponents indicates an expected call of ListAllComponents.
func (mr *MockClientMockRecorder) PlayKube(pod interface{}) *gomock.Call
PlayKube indicates an expected call of PlayKube.
func (mr *MockClientMockRecorder) PodLs() *gomock.Call
PodLs indicates an expected call of PodLs.
func (mr *MockClientMockRecorder) PodRm(podname interface{}) *gomock.Call
PodRm indicates an expected call of PodRm.
func (mr *MockClientMockRecorder) PodStop(podname interface{}) *gomock.Call
PodStop indicates an expected call of PodStop.
func (mr *MockClientMockRecorder) PodWatcher(ctx, selector interface{}) *gomock.Call
PodWatcher indicates an expected call of PodWatcher.
func (mr *MockClientMockRecorder) Version(ctx interface{}) *gomock.Call
Version indicates an expected call of Version.
func (mr *MockClientMockRecorder) VolumeLs() *gomock.Call
VolumeLs indicates an expected call of VolumeLs.
func (mr *MockClientMockRecorder) VolumeRm(volumeName interface{}) *gomock.Call
VolumeRm indicates an expected call of VolumeRm.
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 struct {
// contains filtered or unexported fields
}
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 (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)
GetAllPodsInNamespaceMatchingSelector returns all pods matching the given label selector and in the specified namespace.
func (o *PodmanCli) GetAllResourcesFromSelector(selector string, _ string) ([]unstructured.Unstructured, error)
GetAllResourcesFromSelector returns all resources of any kind matching the given label selector.
func (o *PodmanCli) GetCapabilities() (Capabilities, error)
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 (o *PodmanCli) GetPodUsingComponentName(componentName string) (*corev1.Pod, error)
func (o *PodmanCli) GetPodsMatchingSelector(selector string) (*corev1.PodList, error)
GetPodsMatchingSelector returns all pods matching the given label selector.
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 (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)
Version returns the version of the Podman client.
func (o *PodmanCli) VolumeLs() (map[string]bool, error)
func (o *PodmanCli) VolumeRm(volumeName string) error
type PodmanNotFoundError struct {
// contains filtered or unexported fields
}
func NewPodmanNotFoundError(err error) PodmanNotFoundError
func (o PodmanNotFoundError) Error() string
type SystemVersionReport struct { Client *Version `json:",omitempty"` }
type Version struct { APIVersion string Version string GoVersion string GitCommit string BuiltTime string Built int64 OsArch string Os string }