Documentation
¶
Index ¶
- func CheckTestRunner(runner string) error
- func InferImageFormat(imagePath string) (string, error)
- func NewImageBootCmd() *cobra.Command
- func NewImageBuildCmd() *cobra.Command
- func NewImageCustomizeCmd() *cobra.Command
- func NewImageInjectFilesCmd() *cobra.Command
- func NewImageListCommand() *cobra.Command
- func NewImageTestCmd() *cobra.Command
- func OnAppInit(app *azldev.App)
- func QEMUDriver(format string) string
- func ResolveImageByName(env *azldev.Env, imageName string) (*projectconfig.ImageConfig, error)
- func ResolveQcow2Image(env *azldev.Env, imagePath string) (string, error)
- func SupportedImageFormats() []string
- type ImageArch
- type ImageBootOptions
- type ImageBuildOptions
- type ImageBuildResult
- type ImageDefinitionResult
- type ImageFormat
- type ImageListResult
- type ImageTestOptions
- type ListImageOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckTestRunner ¶
CheckTestRunner returns an error if the test runner is not supported.
func InferImageFormat ¶
InferImageFormat determines the image format from the file extension. Returns an error if the extension does not match a supported format.
func NewImageBootCmd ¶
NewImageBootCmd constructs a cobra.Command for the 'image boot' command.
func NewImageBuildCmd ¶
Constructs a cobra.Command for the 'image build' command.
func NewImageCustomizeCmd ¶
Constructs a cobra.Command for the 'project new' command.
func NewImageInjectFilesCmd ¶
Constructs a cobra.Command for the 'project new' command.
func NewImageListCommand ¶
Constructs a cobra.Command for "image list" CLI subcommand.
func NewImageTestCmd ¶
NewImageTestCmd constructs a cobra.Command for the 'image test' command.
func OnAppInit ¶
Called once when the app is initialized; registers any commands or callbacks with the app.
func QEMUDriver ¶
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 ¶
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" )
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.