image

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 License: Apache-2.0 Imports: 53 Imported by: 2

Documentation

Index

Constants

View Source
const (

	//OcDefaultTries is the number of times to execute the oc command on failues
	OcDefaultTries = 5
	// OcDefaultRetryDelay is the time between retries
	OcDefaultRetryDelay = time.Second * 5
)

Variables

View Source
var GetIsoPluggable = downloadIso

GetIsoPluggable defines the method to use get the baseIso file

Functions

func DownloadImageFile added in v0.9.2

func DownloadImageFile(baseURL string) (string, error)

DownloadImageFile is a helper function that obtains an image file from a given URL, puts it in the cache and returns the local file path. If the file is compressed by a known compressor, the file is uncompressed prior to being returned.

func GetCacheDir added in v0.9.2

func GetCacheDir(dataType string) (string, error)

GetCacheDir returns a local path of the cache, where the installer should put the data: <user_cache_dir>/agent/<dataType>_cache If the directory doesn't exist, it will be automatically created.

func GetFileFromCache added in v0.9.2

func GetFileFromCache(fileName string, cacheDir string) (string, error)

GetFileFromCache returns path of the cached file if found, otherwise returns an empty string or error

func RetrieveRendezvousIP

func RetrieveRendezvousIP(agentConfig *agent.Config, nmStateConfigs []*v1beta1.NMStateConfig) (string, error)

RetrieveRendezvousIP Returns the Rendezvous IP from either AgentConfig or NMStateConfig

Types

type AgentImage

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

AgentImage is an asset that generates the bootable image used to install clusters.

func (*AgentImage) Dependencies

func (a *AgentImage) Dependencies() []asset.Asset

Dependencies returns the assets on which the Bootstrap asset depends.

func (*AgentImage) Files

func (a *AgentImage) Files() []*asset.File

Files returns the files generated by the asset.

func (*AgentImage) Generate

func (a *AgentImage) Generate(dependencies asset.Parents) error

Generate generates the image file for to ISO asset.

func (*AgentImage) Load

func (a *AgentImage) Load(f asset.FileFetcher) (bool, error)

Load returns the ISO from disk.

func (*AgentImage) Name

func (a *AgentImage) Name() string

Name returns the human-friendly name of the asset.

func (*AgentImage) PersistToFile

func (a *AgentImage) PersistToFile(directory string) error

PersistToFile writes the iso image in the assets folder

type AgentPXEFiles

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

AgentPXEFiles is an asset that generates the bootable image used to install clusters.

func (*AgentPXEFiles) Dependencies

func (a *AgentPXEFiles) Dependencies() []asset.Asset

Dependencies returns the assets on which the AgentPXEFiles asset depends.

func (*AgentPXEFiles) Files

func (a *AgentPXEFiles) Files() []*asset.File

Files returns the files generated by the asset.

func (*AgentPXEFiles) Generate

func (a *AgentPXEFiles) Generate(dependencies asset.Parents) error

Generate generates the image files for PXE asset.

func (*AgentPXEFiles) Load

func (a *AgentPXEFiles) Load(f asset.FileFetcher) (bool, error)

Load returns the PXE image from disk.

func (*AgentPXEFiles) Name

func (a *AgentPXEFiles) Name() string

Name returns the human-friendly name of the asset.

func (*AgentPXEFiles) PersistToFile

func (a *AgentPXEFiles) PersistToFile(directory string) error

PersistToFile writes the PXE assets in the assets folder named pxe.

type BaseIso

type BaseIso struct {
	File *asset.File
}

BaseIso generates the base ISO file for the image

func (*BaseIso) Dependencies

func (i *BaseIso) Dependencies() []asset.Asset

Dependencies returns dependencies used by the asset.

func (*BaseIso) Files

func (i *BaseIso) Files() []*asset.File

Files returns the files generated by the asset.

func (*BaseIso) Generate

func (i *BaseIso) Generate(dependencies asset.Parents) error

Generate the baseIso

func (*BaseIso) Load

func (i *BaseIso) Load(f asset.FileFetcher) (bool, error)

Load returns the cached baseIso

func (*BaseIso) Name

func (i *BaseIso) Name() string

Name returns the human-friendly name of the asset.

type Config

type Config struct {
	MaxTries   uint
	RetryDelay time.Duration
}

Config is used to set up the retries for extracting the base ISO

type CpioArchive

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

CpioArchive simplifies the creation of a compressed cpio archive.

func NewCpioArchive

func NewCpioArchive() *CpioArchive

NewCpioArchive creates a new CpioArchive instance.

func (*CpioArchive) Save

func (ca *CpioArchive) Save(archivePath string) error

Save the content of the current archive on the disk.

func (*CpioArchive) SaveBuffer

func (ca *CpioArchive) SaveBuffer() ([]byte, error)

SaveBuffer saves the content of the current archive and returns the buffer content.

func (*CpioArchive) StoreBytes

func (ca *CpioArchive) StoreBytes(filename string, content []byte, mode int) error

StoreBytes appends to the current archive the given content using the specified filename.

func (*CpioArchive) StoreFile

func (ca *CpioArchive) StoreFile(filename string, dstPath string) error

StoreFile appends to the current archive the specified file.

func (*CpioArchive) StorePath

func (ca *CpioArchive) StorePath(path string) error

StorePath adds a new path in the archive.

type Ignition

type Ignition struct {
	Config       *igntypes.Config
	CPUArch      string
	RendezvousIP string
}

Ignition is an asset that generates the agent installer ignition file.

func (*Ignition) Dependencies

func (a *Ignition) Dependencies() []asset.Asset

Dependencies returns the assets on which the Ignition asset depends.

func (*Ignition) Generate

func (a *Ignition) Generate(dependencies asset.Parents) error

Generate generates the agent installer ignition.

func (*Ignition) Name

func (a *Ignition) Name() string

Name returns the human-friendly name of the asset.

type Release

type Release interface {
	GetBaseIso(architecture string) (string, error)
	ExtractFile(image string, filename string) ([]string, error)
}

Release is the interface to use the oc command to the get image info

func NewRelease

func NewRelease(executer executer.Executer, config Config, releaseImage string, pullSecret string, mirrorConfig []mirror.RegistriesConfig) Release

NewRelease is used to set up the executor to run oc commands

Jump to

Keyboard shortcuts

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