image

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2026 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckTestRunner

func CheckTestRunner(runner string) error

CheckTestRunner returns an error if the test runner is not supported.

func InferImageFormat

func InferImageFormat(imagePath string) (string, error)

InferImageFormat determines the image format from the file extension. Returns an error if the extension does not match a supported format.

func NewImageBootCmd

func NewImageBootCmd() *cobra.Command

NewImageBootCmd constructs a cobra.Command for the 'image boot' command.

func NewImageBuildCmd

func NewImageBuildCmd() *cobra.Command

Constructs a cobra.Command for the 'image build' command.

func NewImageCustomizeCmd

func NewImageCustomizeCmd() *cobra.Command

Constructs a cobra.Command for the 'project new' command.

func NewImageInjectFilesCmd

func NewImageInjectFilesCmd() *cobra.Command

Constructs a cobra.Command for the 'project new' command.

func NewImageListCommand

func NewImageListCommand() *cobra.Command

Constructs a cobra.Command for "image list" CLI subcommand.

func NewImageTestCmd

func NewImageTestCmd() *cobra.Command

NewImageTestCmd constructs a cobra.Command for the 'image test' command.

func OnAppInit

func OnAppInit(app *azldev.App)

Called once when the app is initialized; registers any commands or callbacks with the app.

func QEMUDriver

func QEMUDriver(format string) string

QEMUDriver returns the QEMU block driver name for the image format. Most formats use their string value directly, but some (e.g., vhd → vpc) require translation.

func ResolveImageByName

func ResolveImageByName(env *azldev.Env, imageName string) (*projectconfig.ImageConfig, error)

ResolveImageByName is like resolveImage but includes a list of available images in the error message when the image is not found.

func ResolveQcow2Image

func ResolveQcow2Image(env *azldev.Env, imagePath string) (string, error)

ResolveQcow2Image inspects the image at imagePath and returns a path to a qcow2 image. If the image is already qcow2 it is returned as-is. If it is vhd or vhdfixed it is converted to qcow2 in a temporary directory. Any other format is an error.

func SupportedImageFormats

func SupportedImageFormats() []string

SupportedImageFormats returns the list of supported bootable image formats in priority order. When multiple formats exist, the first match in this order is selected.

Types

type ImageArch

type ImageArch string

ImageArch represents the architecture of an image, such as "x86_64" or "aarch64".

const (
	// ImageArchDefault represents the default architecture (i.e., the host architecture).
	ImageArchDefault ImageArch = ""

	// ImageArchX86_64 represents the x86_64 architecture.
	ImageArchX86_64 ImageArch = "x86_64"

	// ImageArchAarch64 represents the aarch64 (a.k.a. arm64) architecture.
	ImageArchAarch64 ImageArch = "aarch64"
)

func (*ImageArch) Set

func (f *ImageArch) Set(value string) error

Parses the architecture from a string; used by command-line parser.

func (*ImageArch) String

func (f *ImageArch) String() string

func (*ImageArch) Type

func (f *ImageArch) Type() string

Returns a descriptive string used in command-line help.

type ImageBootOptions

type ImageBootOptions struct {
	Arch                    qemu.Arch
	AuthorizedPublicKeyPath string
	UseDiskRW               bool
	ImageName               string
	ImagePath               string
	Format                  ImageFormat
	SecureBoot              bool
	TestUserName            string
	TestUserPassword        string
	TestUserPasswordFile    string
	SSHPort                 uint16
	CPUs                    int
	Memory                  string
}

ImageBootOptions contains options for the boot command.

type ImageBuildOptions

type ImageBuildOptions struct {
	// Name of the image to build.
	ImageName string

	// Paths to local repositories to include during build.
	LocalRepoPaths []string

	// URIs to remote repositories (http:// or https://) to include during build.
	RemoteRepoPaths []string

	// NoRemoteRepoGpgCheck disables GPG checking for all remote repositories
	// specified via RemoteRepoPaths.
	NoRemoteRepoGpgCheck bool

	// RemoteRepoIncludeInImage marks all remote repositories specified via RemoteRepoPaths
	// as part of the system image repository setup (imageinclude=true).
	RemoteRepoIncludeInImage bool

	// TargetArch specifies the target architecture to build for (e.g., "x86_64" or "aarch64").
	// If left empty, the host architecture will be used.
	TargetArch ImageArch
}

Options for building images.

type ImageBuildResult

type ImageBuildResult struct {
	// Name of the image that was built.
	ImageName string `json:"imageName" table:",sortkey"`

	// Path to the output directory containing the built image.
	OutputDir string `json:"outputDir" table:"Output Dir"`

	// Paths to the artifact files that were linked into the output directory.
	ArtifactPaths []string `json:"artifactPaths" table:"Artifact Paths"`
}

ImageBuildResult summarizes the results of building an image.

func BuildImage

func BuildImage(env *azldev.Env, options *ImageBuildOptions) (*ImageBuildResult, error)

BuildImage builds the specified image using kiwi-ng.

type ImageDefinitionResult

type ImageDefinitionResult struct {
	// Type indicates the type of image definition (e.g., "kiwi").
	Type string `json:"type"`

	// Path points to the image definition file.
	Path string `json:"path"`
}

ImageDefinitionResult represents the definition details for an image.

type ImageFormat

type ImageFormat string

ImageFormat represents a bootable disk image format.

const (
	// ImageFormatRaw is the raw disk image format.
	ImageFormatRaw ImageFormat = "raw"
	// ImageFormatQcow2 is the QEMU copy-on-write v2 format.
	ImageFormatQcow2 ImageFormat = "qcow2"
	// ImageFormatVhd is the Hyper-V VHD format (QEMU driver: vpc).
	ImageFormatVhd ImageFormat = "vhd"
	// ImageFormatVhdx is the Hyper-V virtual hard disk format.
	ImageFormatVhdx ImageFormat = "vhdx"
)

func (*ImageFormat) Set

func (f *ImageFormat) Set(value string) error

Set parses and validates the image format value from a string.

func (*ImageFormat) String

func (f *ImageFormat) String() string

func (*ImageFormat) Type

func (f *ImageFormat) Type() string

Type returns a descriptive string used in command-line help.

type ImageListResult

type ImageListResult struct {
	// Name of the image.
	Name string `json:"name" table:",sortkey"`

	// Description of the image.
	Description string `json:"description"`

	// Definition contains the image definition details (hidden from table output).
	Definition ImageDefinitionResult `json:"definition" table:"-"`
}

ImageListResult represents an image in the list output.

func ListImages

func ListImages(env *azldev.Env, options *ListImageOptions) ([]ImageListResult, error)

ListImages lists images in the env, in accordance with options. Returns the found images.

type ImageTestOptions

type ImageTestOptions struct {
	ImagePath           string
	TestRunner          string
	RunbookPath         string
	AdminPrivateKeyPath string
}

ImageTestOptions holds the options for the 'image test' command.

type ListImageOptions

type ListImageOptions struct {
	// Name patterns to filter images. Supports glob patterns (*, ?, []).
	ImageNamePatterns []string
}

Options for listing images within the environment.

Jump to

Keyboard shortcuts

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