isoeditor

package
v0.0.0-...-e35e6a1 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 License: Apache-2.0 Imports: 25 Imported by: 14

Documentation

Overview

Package isoeditor is a generated GoMock package.

Package isoeditor is a generated GoMock package.

Package isoeditor is a generated GoMock package.

Package isoeditor is a generated GoMock package.

Package isoeditor is a generated GoMock package.

Index

Constants

View Source
const (
	AMD64CPUArchitecture   = "amd64"
	X86CPUArchitecture     = "x86_64"
	ARM64CPUArchitecture   = "arm64"
	AARCH64CPUArchitecture = "aarch64"
)
View Source
const (
	RamDiskPaddingLength    = uint64(1024 * 1024) // 1MB
	NmstatectlPathInRamdisk = "/usr/bin/nmstatectl"

	MinimalVersionForNmstatectl = "4.18.0-ec.0"
	RootfsImagePath             = "images/pxeboot/rootfs.img"
)

Variables

This section is empty.

Functions

func Create

func Create(outPath string, workDir string, volumeLabel string) error

Create builds an iso file at outPath with the given volumeLabel using the contents of the working directory

func CreateMinimalISO

func CreateMinimalISO(extractDir, volumeID, rootFSURL, arch, minimalISOPath string) error

CreateMinimalISO Creates the minimal iso by removing the rootfs and adding the url

func Extract

func Extract(isoPath string, workDir string) error

Extract unpacks the iso contents into the working directory

func GetFileFromISO

func GetFileFromISO(isoPath, filePath string) (filesystem.File, error)

Gets a readWrite seeker of a specific file from the ISO image

func GetISO9660FileSystem

func GetISO9660FileSystem(d *disk.Disk) (filesystem.FileSystem, error)

Gets directly the ISO 9660 filesystem (equivalent to GetFileSystem(0)).

func GetISOFileInfo

func GetISOFileInfo(filePath, isoPath string) (int64, int64, error)

func KargsFiles

func KargsFiles(isoPath string) ([]string, error)

func KargsToStr

func KargsToStr(args []string) (string, error)

func NewInitRamFSStreamReader

func NewInitRamFSStreamReader(irfsPath string, ignitionContent *IgnitionContent) (overlay.OverlayReader, error)

func NewInitRamFSStreamReaderFromISO

func NewInitRamFSStreamReaderFromISO(isoPath string, ignitionContent *IgnitionContent) (overlay.OverlayReader, error)

func NewInitrdAddrsizeReader

func NewInitrdAddrsizeReader(iafsPath string, initrdFile overlay.OverlayReader) (*bytes.Reader, error)

func NewInitrdAddrsizeReaderFromISO

func NewInitrdAddrsizeReaderFromISO(isoPath string, initrdFile overlay.OverlayReader) (*bytes.Reader, error)

func NewInitrdAddrsizeReaderFromStream

func NewInitrdAddrsizeReaderFromStream(irfsReader io.ReadSeekCloser, initrdFile overlay.OverlayReader) (*bytes.Reader, error)

func ReadFileFromISO

func ReadFileFromISO(isoPath, filePath string) ([]byte, error)

Reads a whole specific file from the ISO image

func StrToKargs

func StrToKargs(kargsStr string) ([]string, error)

func VolumeIdentifier

func VolumeIdentifier(isoPath string) (string, error)

Types

type BoundariesFinder

type BoundariesFinder func(filePath, isoPath string) (int64, int64, error)

type CommonExecuter

type CommonExecuter struct{}

func (*CommonExecuter) Execute

func (e *CommonExecuter) Execute(command, workDir string) (string, error)

type Editor

type Editor interface {
	CreateMinimalISOTemplate(fullISOPath, rootFSURL, arch, minimalISOPath, openshiftVersion, nmstatectlPath string) error
}

func NewEditor

func NewEditor(dataDir string, nmstateHandler NmstateHandler) Editor

type Executer

type Executer interface {
	Execute(command, workDir string) (string, error)
}

type FileData

type FileData struct {
	Filename string
	Data     io.ReadCloser
}

func NewIgnitionImageReader

func NewIgnitionImageReader(isoPath string, ignitionContent *IgnitionContent) ([]FileData, error)

NewIgnitionImageReader returns the filename of the ignition image in the ISO, along with a stream of the ignition image with ignition content embedded. This can be used to overwrite the ignition image file of an ISO previously unpacked by Extract() in order to embed ignition data.

func NewKargsReader

func NewKargsReader(isoPath string, appendKargs string) ([]FileData, error)

NewKargsReader returns the filename within an ISO and the new content of the file(s) containing the kernel arguments, with additional arguments appended.

type FileReader

type FileReader func(isoPath, filePath string) ([]byte, error)

type IgnitionContent

type IgnitionContent struct {
	Config        []byte
	SystemConfigs map[string][]byte
}

func (*IgnitionContent) Archive

func (ic *IgnitionContent) Archive() (*bytes.Reader, error)

type ImageReader

type ImageReader = overlay.OverlayReader

func NewRHCOSStreamReader

func NewRHCOSStreamReader(isoPath string, ignitionContent *IgnitionContent, ramdiskContent []byte, kargs []byte) (ImageReader, error)

type MockEditor

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

MockEditor is a mock of Editor interface.

func NewMockEditor

func NewMockEditor(ctrl *gomock.Controller) *MockEditor

NewMockEditor creates a new mock instance.

func (*MockEditor) CreateMinimalISOTemplate

func (m *MockEditor) CreateMinimalISOTemplate(fullISOPath, rootFSURL, arch, minimalISOPath, openshiftVersion, nmstatectlPath string) error

CreateMinimalISOTemplate mocks base method.

func (*MockEditor) EXPECT

func (m *MockEditor) EXPECT() *MockEditorMockRecorder

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

type MockEditorMockRecorder

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

MockEditorMockRecorder is the mock recorder for MockEditor.

func (*MockEditorMockRecorder) CreateMinimalISOTemplate

func (mr *MockEditorMockRecorder) CreateMinimalISOTemplate(fullISOPath, rootFSURL, arch, minimalISOPath, openshiftVersion, nmstatectlPath any) *gomock.Call

CreateMinimalISOTemplate indicates an expected call of CreateMinimalISOTemplate.

type MockExecuter

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

MockExecuter is a mock of Executer interface.

func NewMockExecuter

func NewMockExecuter(ctrl *gomock.Controller) *MockExecuter

NewMockExecuter creates a new mock instance.

func (*MockExecuter) EXPECT

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

func (*MockExecuter) Execute

func (m *MockExecuter) Execute(command, workDir string) (string, error)

Execute mocks base method.

type MockExecuterMockRecorder

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

MockExecuterMockRecorder is the mock recorder for MockExecuter.

func (*MockExecuterMockRecorder) Execute

func (mr *MockExecuterMockRecorder) Execute(command, workDir any) *gomock.Call

Execute indicates an expected call of Execute.

type MockNmstateHandler

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

MockNmstateHandler is a mock of NmstateHandler interface.

func NewMockNmstateHandler

func NewMockNmstateHandler(ctrl *gomock.Controller) *MockNmstateHandler

NewMockNmstateHandler creates a new mock instance.

func (*MockNmstateHandler) BuildNmstateCpioArchive

func (m *MockNmstateHandler) BuildNmstateCpioArchive(rootfsPath string) ([]byte, error)

BuildNmstateCpioArchive mocks base method.

func (*MockNmstateHandler) EXPECT

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

type MockNmstateHandlerMockRecorder

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

MockNmstateHandlerMockRecorder is the mock recorder for MockNmstateHandler.

func (*MockNmstateHandlerMockRecorder) BuildNmstateCpioArchive

func (mr *MockNmstateHandlerMockRecorder) BuildNmstateCpioArchive(rootfsPath any) *gomock.Call

BuildNmstateCpioArchive indicates an expected call of BuildNmstateCpioArchive.

type MockNmstatectlExtractor

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

MockNmstatectlExtractor is a mock of NmstatectlExtractor interface.

func NewMockNmstatectlExtractor

func NewMockNmstatectlExtractor(ctrl *gomock.Controller) *MockNmstatectlExtractor

NewMockNmstatectlExtractor creates a new mock instance.

func (*MockNmstatectlExtractor) EXPECT

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

func (*MockNmstatectlExtractor) ExtractNmstatectl

func (m *MockNmstatectlExtractor) ExtractNmstatectl(nmstateDir string) (string, error)

ExtractNmstatectl mocks base method.

type MockNmstatectlExtractorFactory

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

MockNmstatectlExtractorFactory is a mock of NmstatectlExtractorFactory interface.

func NewMockNmstatectlExtractorFactory

func NewMockNmstatectlExtractorFactory(ctrl *gomock.Controller) *MockNmstatectlExtractorFactory

NewMockNmstatectlExtractorFactory creates a new mock instance.

func (*MockNmstatectlExtractorFactory) CreateNmstatectlExtractor

func (m *MockNmstatectlExtractorFactory) CreateNmstatectlExtractor(nmstateDir string) (NmstatectlExtractor, error)

CreateNmstatectlExtractor mocks base method.

func (*MockNmstatectlExtractorFactory) EXPECT

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

type MockNmstatectlExtractorFactoryMockRecorder

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

MockNmstatectlExtractorFactoryMockRecorder is the mock recorder for MockNmstatectlExtractorFactory.

func (*MockNmstatectlExtractorFactoryMockRecorder) CreateNmstatectlExtractor

func (mr *MockNmstatectlExtractorFactoryMockRecorder) CreateNmstatectlExtractor(nmstateDir any) *gomock.Call

CreateNmstatectlExtractor indicates an expected call of CreateNmstatectlExtractor.

type MockNmstatectlExtractorMockRecorder

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

MockNmstatectlExtractorMockRecorder is the mock recorder for MockNmstatectlExtractor.

func (*MockNmstatectlExtractorMockRecorder) ExtractNmstatectl

func (mr *MockNmstatectlExtractorMockRecorder) ExtractNmstatectl(nmstateDir any) *gomock.Call

ExtractNmstatectl indicates an expected call of ExtractNmstatectl.

type NmstateHandler

type NmstateHandler interface {
	BuildNmstateCpioArchive(rootfsPath string) ([]byte, error)
}

func NewNmstateHandler

func NewNmstateHandler(workDir string, executer Executer, nmstatectlExtractorFactory NmstatectlExtractorFactory) NmstateHandler

type NmstatectlExtractor

type NmstatectlExtractor interface {
	ExtractNmstatectl(nmstateDir string) (string, error)
}

type NmstatectlExtractorFactory

type NmstatectlExtractorFactory interface {
	CreateNmstatectlExtractor(nmstateDir string) (NmstatectlExtractor, error)
}

func NewNmstatectlExtractorFactory

func NewNmstatectlExtractorFactory(executer Executer) NmstatectlExtractorFactory

type StreamGeneratorFunc

type StreamGeneratorFunc func(isoPath string, ignitionContent *IgnitionContent, ramdiskContent, kargs []byte) (ImageReader, error)

Jump to

Keyboard shortcuts

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