imagemgmt

package
v0.0.0-...-d416164 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Code generated by MockGen. DO NOT EDIT. Source: imagemgmt.go

Generated by this command:

mockgen -source=imagemgmt.go -package=imagemgmt -destination=mock_imagemgmt.go

Package imagemgmt is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ImageMgmtClient

type ImageMgmtClient struct {
	Log         *logr.Logger
	Executor    ops.Execute
	StoragePath string
}

func (*ImageMgmtClient) CheckDiskUsageAgainstThreshold

func (c *ImageMgmtClient) CheckDiskUsageAgainstThreshold(thresholdPercent int) (bool, error)

CheckDiskUsageAgainstThreshold gets the disk usage for the specified path and checks whether it exceeds the specified threshold

func (*ImageMgmtClient) CleanupUnusedImages

func (c *ImageMgmtClient) CleanupUnusedImages(thresholdPercent int) error

CleanupUnusedImages iterates through the image removal candidates, deleting in sets of 5 until the container storage disk usage threshold is met

func (*ImageMgmtClient) GetInuseImages

func (c *ImageMgmtClient) GetInuseImages() (inUse []string, rc error)

GetInuseImages gets the list of images in use by cri-o or podman containers

func (*ImageMgmtClient) GetPinnedImages

func (c *ImageMgmtClient) GetPinnedImages() (pinned []string, rc error)

GetPinnedImages gets the list of pinned images, from crictl

func (*ImageMgmtClient) GetRemovalCandidates

func (c *ImageMgmtClient) GetRemovalCandidates() (removalCandidates []imageMgmtImageInfo, rc error)

GetRemovalCandidates gets the list of images sorted by creation timestamp, filtering out in-use and pinned images

type ImageMgmtIntf

type ImageMgmtIntf interface {
	CheckDiskUsageAgainstThreshold(thresholdPercent int) (bool, error)
	GetInuseImages() (inUse []string, rc error)
	GetPinnedImages() (pinned []string, rc error)
	GetRemovalCandidates() (removalCandidates []imageMgmtImageInfo, rc error)
	CleanupUnusedImages(thresholdPercent int) error
}

ImageMgmtIntf is an interface for LCA iamge management commands.

func NewImageMgmtClient

func NewImageMgmtClient(log *logr.Logger, hostCommandsExecutor ops.Execute, storagePath string) ImageMgmtIntf

NewImageMgmtClient creates and returns a ImageMgmtIntf interface for image management commands

type MockImageMgmtIntf

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

MockImageMgmtIntf is a mock of ImageMgmtIntf interface.

func NewMockImageMgmtIntf

func NewMockImageMgmtIntf(ctrl *gomock.Controller) *MockImageMgmtIntf

NewMockImageMgmtIntf creates a new mock instance.

func (*MockImageMgmtIntf) CheckDiskUsageAgainstThreshold

func (m *MockImageMgmtIntf) CheckDiskUsageAgainstThreshold(thresholdPercent int) (bool, error)

CheckDiskUsageAgainstThreshold mocks base method.

func (*MockImageMgmtIntf) CleanupUnusedImages

func (m *MockImageMgmtIntf) CleanupUnusedImages(thresholdPercent int) error

CleanupUnusedImages mocks base method.

func (*MockImageMgmtIntf) EXPECT

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

func (*MockImageMgmtIntf) GetInuseImages

func (m *MockImageMgmtIntf) GetInuseImages() ([]string, error)

GetInuseImages mocks base method.

func (*MockImageMgmtIntf) GetPinnedImages

func (m *MockImageMgmtIntf) GetPinnedImages() ([]string, error)

GetPinnedImages mocks base method.

func (*MockImageMgmtIntf) GetRemovalCandidates

func (m *MockImageMgmtIntf) GetRemovalCandidates() ([]imageMgmtImageInfo, error)

GetRemovalCandidates mocks base method.

type MockImageMgmtIntfMockRecorder

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

MockImageMgmtIntfMockRecorder is the mock recorder for MockImageMgmtIntf.

func (*MockImageMgmtIntfMockRecorder) CheckDiskUsageAgainstThreshold

func (mr *MockImageMgmtIntfMockRecorder) CheckDiskUsageAgainstThreshold(thresholdPercent any) *gomock.Call

CheckDiskUsageAgainstThreshold indicates an expected call of CheckDiskUsageAgainstThreshold.

func (*MockImageMgmtIntfMockRecorder) CleanupUnusedImages

func (mr *MockImageMgmtIntfMockRecorder) CleanupUnusedImages(thresholdPercent any) *gomock.Call

CleanupUnusedImages indicates an expected call of CleanupUnusedImages.

func (*MockImageMgmtIntfMockRecorder) GetInuseImages

func (mr *MockImageMgmtIntfMockRecorder) GetInuseImages() *gomock.Call

GetInuseImages indicates an expected call of GetInuseImages.

func (*MockImageMgmtIntfMockRecorder) GetPinnedImages

func (mr *MockImageMgmtIntfMockRecorder) GetPinnedImages() *gomock.Call

GetPinnedImages indicates an expected call of GetPinnedImages.

func (*MockImageMgmtIntfMockRecorder) GetRemovalCandidates

func (mr *MockImageMgmtIntfMockRecorder) GetRemovalCandidates() *gomock.Call

GetRemovalCandidates indicates an expected call of GetRemovalCandidates.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL