ops

package
v0.0.0-...-0b715c1 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

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

Generated by this command:

mockgen -source=execute.go -package=ops -destination=mock_execute.go

Package ops is a generated GoMock package.

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

Generated by this command:

mockgen -source=ops.go -package=ops -destination=mock_ops.go

Package ops is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockDevice

type BlockDevice struct {
	Name  string
	Label string
}

type CMD

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

func NewCMD

func NewCMD(command string, args ...string) *CMD

type Execute

type Execute interface {
	Execute(command string, args ...string) (string, error)
	ExecuteWithLiveLogger(command string, args ...string) (string, error)
}

Execute is an interface for executing external commands and capturing their output.

func NewChrootExecutor

func NewChrootExecutor(logger *logrus.Logger, verbose bool, root string) Execute

func NewNsenterExecutor

func NewNsenterExecutor(logger *logrus.Logger, verbose bool) Execute

func NewRegularExecutor

func NewRegularExecutor(logger *logrus.Logger, verbose bool) Execute

type MockExecute

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

MockExecute is a mock of Execute interface.

func NewMockExecute

func NewMockExecute(ctrl *gomock.Controller) *MockExecute

NewMockExecute creates a new mock instance.

func (*MockExecute) EXPECT

func (m *MockExecute) EXPECT() *MockExecuteMockRecorder

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

func (*MockExecute) Execute

func (m *MockExecute) Execute(command string, args ...string) (string, error)

Execute mocks base method.

func (*MockExecute) ExecuteWithLiveLogger

func (m *MockExecute) ExecuteWithLiveLogger(command string, args ...string) (string, error)

ExecuteWithLiveLogger mocks base method.

type MockExecuteMockRecorder

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

MockExecuteMockRecorder is the mock recorder for MockExecute.

func (*MockExecuteMockRecorder) Execute

func (mr *MockExecuteMockRecorder) Execute(command any, args ...any) *gomock.Call

Execute indicates an expected call of Execute.

func (*MockExecuteMockRecorder) ExecuteWithLiveLogger

func (mr *MockExecuteMockRecorder) ExecuteWithLiveLogger(command any, args ...any) *gomock.Call

ExecuteWithLiveLogger indicates an expected call of ExecuteWithLiveLogger.

type MockOps

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

MockOps is a mock of Ops interface.

func NewMockOps

func NewMockOps(ctrl *gomock.Controller) *MockOps

NewMockOps creates a new mock instance.

func (*MockOps) Chroot

func (m *MockOps) Chroot(chrootPath string) (func() error, error)

Chroot mocks base method.

func (*MockOps) CreateExtraPartition

func (m *MockOps) CreateExtraPartition(installationDisk, extraPartitionLabel, extraPartitionStart string, extraPartitionNumber uint) error

CreateExtraPartition mocks base method.

func (*MockOps) CreateIsoWithEmbeddedIgnition

func (m *MockOps) CreateIsoWithEmbeddedIgnition(log logrus.FieldLogger, ignitionBytes []byte, baseIsoPath, outputIsoPath string) error

CreateIsoWithEmbeddedIgnition mocks base method.

func (*MockOps) EXPECT

func (m *MockOps) EXPECT() *MockOpsMockRecorder

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

func (*MockOps) ExtractTarWithSELinux

func (m *MockOps) ExtractTarWithSELinux(srcPath, destPath string) error

ExtractTarWithSELinux mocks base method.

func (*MockOps) ForceExpireSeedCrypto

func (m *MockOps) ForceExpireSeedCrypto(recertContainerImage, authFile string, hasKubeAdminPassword bool) error

ForceExpireSeedCrypto mocks base method.

func (*MockOps) GetContainerStorageTarget

func (m *MockOps) GetContainerStorageTarget() (string, error)

GetContainerStorageTarget mocks base method.

func (*MockOps) GetHostname

func (m *MockOps) GetHostname() (string, error)

GetHostname mocks base method.

func (*MockOps) ImageExists

func (m *MockOps) ImageExists(img string) (bool, error)

ImageExists mocks base method.

func (*MockOps) IsImageMounted

func (m *MockOps) IsImageMounted(img string) (bool, error)

IsImageMounted mocks base method.

func (*MockOps) ListBlockDevices

func (m *MockOps) ListBlockDevices() ([]BlockDevice, error)

ListBlockDevices mocks base method.

func (*MockOps) Mount

func (m *MockOps) Mount(deviceName, mountFolder string) error

Mount mocks base method.

func (*MockOps) RecertFullFlow

func (m *MockOps) RecertFullFlow(recertContainerImage, authFile, configFile string, preRecertOperations, postRecertOperations func() error, additionalPodmanParams ...string) error

RecertFullFlow mocks base method.

func (*MockOps) RemountSysroot

func (m *MockOps) RemountSysroot() error

RemountSysroot mocks base method.

func (*MockOps) RestoreOriginalSeedCrypto

func (m *MockOps) RestoreOriginalSeedCrypto(recertContainerImage, authFile string) error

RestoreOriginalSeedCrypto mocks base method.

func (*MockOps) RunBashInHostNamespace

func (m *MockOps) RunBashInHostNamespace(command string, args ...string) (string, error)

RunBashInHostNamespace mocks base method.

func (*MockOps) RunInHostNamespace

func (m *MockOps) RunInHostNamespace(command string, args ...string) (string, error)

RunInHostNamespace mocks base method.

func (*MockOps) RunListOfCommands

func (m *MockOps) RunListOfCommands(cmds []*CMD) error

RunListOfCommands mocks base method.

func (*MockOps) RunRecert

func (m *MockOps) RunRecert(recertContainerImage, authFile, recertConfigFile string, additionalPodmanParams ...string) error

RunRecert mocks base method.

func (*MockOps) RunUnauthenticatedEtcdServer

func (m *MockOps) RunUnauthenticatedEtcdServer(authFile, name string) error

RunUnauthenticatedEtcdServer mocks base method.

func (*MockOps) SetupContainersFolderCommands

func (m *MockOps) SetupContainersFolderCommands() error

SetupContainersFolderCommands mocks base method.

func (*MockOps) SystemctlAction

func (m *MockOps) SystemctlAction(action string, args ...string) (string, error)

SystemctlAction mocks base method.

func (*MockOps) Umount

func (m *MockOps) Umount(deviceName string) error

Umount mocks base method.

func (*MockOps) UnmountAndRemoveImage

func (m *MockOps) UnmountAndRemoveImage(img string) error

UnmountAndRemoveImage mocks base method.

type MockOpsMockRecorder

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

MockOpsMockRecorder is the mock recorder for MockOps.

func (*MockOpsMockRecorder) Chroot

func (mr *MockOpsMockRecorder) Chroot(chrootPath any) *gomock.Call

Chroot indicates an expected call of Chroot.

func (*MockOpsMockRecorder) CreateExtraPartition

func (mr *MockOpsMockRecorder) CreateExtraPartition(installationDisk, extraPartitionLabel, extraPartitionStart, extraPartitionNumber any) *gomock.Call

CreateExtraPartition indicates an expected call of CreateExtraPartition.

func (*MockOpsMockRecorder) CreateIsoWithEmbeddedIgnition

func (mr *MockOpsMockRecorder) CreateIsoWithEmbeddedIgnition(log, ignitionBytes, baseIsoPath, outputIsoPath any) *gomock.Call

CreateIsoWithEmbeddedIgnition indicates an expected call of CreateIsoWithEmbeddedIgnition.

func (*MockOpsMockRecorder) ExtractTarWithSELinux

func (mr *MockOpsMockRecorder) ExtractTarWithSELinux(srcPath, destPath any) *gomock.Call

ExtractTarWithSELinux indicates an expected call of ExtractTarWithSELinux.

func (*MockOpsMockRecorder) ForceExpireSeedCrypto

func (mr *MockOpsMockRecorder) ForceExpireSeedCrypto(recertContainerImage, authFile, hasKubeAdminPassword any) *gomock.Call

ForceExpireSeedCrypto indicates an expected call of ForceExpireSeedCrypto.

func (*MockOpsMockRecorder) GetContainerStorageTarget

func (mr *MockOpsMockRecorder) GetContainerStorageTarget() *gomock.Call

GetContainerStorageTarget indicates an expected call of GetContainerStorageTarget.

func (*MockOpsMockRecorder) GetHostname

func (mr *MockOpsMockRecorder) GetHostname() *gomock.Call

GetHostname indicates an expected call of GetHostname.

func (*MockOpsMockRecorder) ImageExists

func (mr *MockOpsMockRecorder) ImageExists(img any) *gomock.Call

ImageExists indicates an expected call of ImageExists.

func (*MockOpsMockRecorder) IsImageMounted

func (mr *MockOpsMockRecorder) IsImageMounted(img any) *gomock.Call

IsImageMounted indicates an expected call of IsImageMounted.

func (*MockOpsMockRecorder) ListBlockDevices

func (mr *MockOpsMockRecorder) ListBlockDevices() *gomock.Call

ListBlockDevices indicates an expected call of ListBlockDevices.

func (*MockOpsMockRecorder) Mount

func (mr *MockOpsMockRecorder) Mount(deviceName, mountFolder any) *gomock.Call

Mount indicates an expected call of Mount.

func (*MockOpsMockRecorder) RecertFullFlow

func (mr *MockOpsMockRecorder) RecertFullFlow(recertContainerImage, authFile, configFile, preRecertOperations, postRecertOperations any, additionalPodmanParams ...any) *gomock.Call

RecertFullFlow indicates an expected call of RecertFullFlow.

func (*MockOpsMockRecorder) RemountSysroot

func (mr *MockOpsMockRecorder) RemountSysroot() *gomock.Call

RemountSysroot indicates an expected call of RemountSysroot.

func (*MockOpsMockRecorder) RestoreOriginalSeedCrypto

func (mr *MockOpsMockRecorder) RestoreOriginalSeedCrypto(recertContainerImage, authFile any) *gomock.Call

RestoreOriginalSeedCrypto indicates an expected call of RestoreOriginalSeedCrypto.

func (*MockOpsMockRecorder) RunBashInHostNamespace

func (mr *MockOpsMockRecorder) RunBashInHostNamespace(command any, args ...any) *gomock.Call

RunBashInHostNamespace indicates an expected call of RunBashInHostNamespace.

func (*MockOpsMockRecorder) RunInHostNamespace

func (mr *MockOpsMockRecorder) RunInHostNamespace(command any, args ...any) *gomock.Call

RunInHostNamespace indicates an expected call of RunInHostNamespace.

func (*MockOpsMockRecorder) RunListOfCommands

func (mr *MockOpsMockRecorder) RunListOfCommands(cmds any) *gomock.Call

RunListOfCommands indicates an expected call of RunListOfCommands.

func (*MockOpsMockRecorder) RunRecert

func (mr *MockOpsMockRecorder) RunRecert(recertContainerImage, authFile, recertConfigFile any, additionalPodmanParams ...any) *gomock.Call

RunRecert indicates an expected call of RunRecert.

func (*MockOpsMockRecorder) RunUnauthenticatedEtcdServer

func (mr *MockOpsMockRecorder) RunUnauthenticatedEtcdServer(authFile, name any) *gomock.Call

RunUnauthenticatedEtcdServer indicates an expected call of RunUnauthenticatedEtcdServer.

func (*MockOpsMockRecorder) SetupContainersFolderCommands

func (mr *MockOpsMockRecorder) SetupContainersFolderCommands() *gomock.Call

SetupContainersFolderCommands indicates an expected call of SetupContainersFolderCommands.

func (*MockOpsMockRecorder) SystemctlAction

func (mr *MockOpsMockRecorder) SystemctlAction(action any, args ...any) *gomock.Call

SystemctlAction indicates an expected call of SystemctlAction.

func (*MockOpsMockRecorder) Umount

func (mr *MockOpsMockRecorder) Umount(deviceName any) *gomock.Call

Umount indicates an expected call of Umount.

func (*MockOpsMockRecorder) UnmountAndRemoveImage

func (mr *MockOpsMockRecorder) UnmountAndRemoveImage(img any) *gomock.Call

UnmountAndRemoveImage indicates an expected call of UnmountAndRemoveImage.

type Ops

type Ops interface {
	SystemctlAction(action string, args ...string) (string, error)
	RunInHostNamespace(command string, args ...string) (string, error)
	RunBashInHostNamespace(command string, args ...string) (string, error)
	RunListOfCommands(cmds []*CMD) error
	ForceExpireSeedCrypto(recertContainerImage, authFile string, hasKubeAdminPassword bool) error
	RestoreOriginalSeedCrypto(recertContainerImage, authFile string) error
	RunUnauthenticatedEtcdServer(authFile, name string) error

	RunRecert(recertContainerImage, authFile, recertConfigFile string, additionalPodmanParams ...string) error
	ExtractTarWithSELinux(srcPath, destPath string) error
	RemountSysroot() error
	ImageExists(img string) (bool, error)
	IsImageMounted(img string) (bool, error)
	UnmountAndRemoveImage(img string) error
	RecertFullFlow(recertContainerImage, authFile, configFile string,
		preRecertOperations func() error, postRecertOperations func() error, additionalPodmanParams ...string) error
	ListBlockDevices() ([]BlockDevice, error)
	Mount(deviceName, mountFolder string) error
	Umount(deviceName string) error
	Chroot(chrootPath string) (func() error, error)
	CreateExtraPartition(installationDisk, extraPartitionLabel, extraPartitionStart string, extraPartitionNumber uint) error
	SetupContainersFolderCommands() error
	GetHostname() (string, error)
	CreateIsoWithEmbeddedIgnition(log logrus.FieldLogger, ignitionBytes []byte, baseIsoPath, outputIsoPath string) error
	GetContainerStorageTarget() (string, error)
	// contains filtered or unexported methods
}

Ops is an interface for executing commands and actions in the host namespace

func NewOps

func NewOps(log *logrus.Logger, hostCommandsExecutor Execute) Ops

NewOps creates and returns an Ops interface for executing host namespace operations

type PodmanImage

type PodmanImage struct {
	Repositories []string `json:"Repositories"`
}

Jump to

Keyboard shortcuts

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