Documentation
¶
Overview ¶
package defs contain the distro definitions used by the "images" library
Index ¶
- Variables
- func ParseID(nameVer string) (*distro.ID, error)
- type DistroYAML
- type ImageTypeYAML
- func (imgType *ImageTypeYAML) ImageConfig(distroNameVer, archName string) (*distro.ImageConfig, error)
- func (imgType *ImageTypeYAML) InstallerConfig(distroNameVer, archName string) (*distro.InstallerConfig, error)
- func (it *ImageTypeYAML) Name() string
- func (imgType *ImageTypeYAML) PackageSets(distroNameVer, archName string) (map[string]rpmmd.PackageSet, error)
- func (imgType *ImageTypeYAML) PartitionTable(distroNameVer, archName string) (*disk.PartitionTable, error)
- func (it *ImageTypeYAML) PlatformsFor(distroNameVer string) ([]platform.PlatformConf, error)
Constants ¶
This section is empty.
Variables ¶
var ( ErrNoPartitionTableForImgType = errors.New("no partition table for image type") ErrNoPartitionTableForArch = errors.New("no partition table for arch") )
Functions ¶
Types ¶
type DistroYAML ¶
type DistroYAML struct {
// Match can be used to match/transform a given name
// into the canonical <distro>-<major>{,.<minor>} form.
// E.g.
// (?P<distro>rhel)-(?P<major>8)\.?(?P<minor>[0-9]+)
// will support a format like e.g. rhel-810 and rhel-8.10
Match string `yaml:"match"`
// The distro metadata, can contain go text template strings
// for {{.Major}}, {{.Minor}} which will be expanded by the
// upper layers.
Name string `yaml:"name"`
Codename string `yaml:"codename"`
Vendor string `yaml:"vendor"`
Preview bool `yaml:"preview"`
OsVersion string `yaml:"os_version"`
ReleaseVersion string `yaml:"release_version"`
ModulePlatformID string `yaml:"module_platform_id"`
Product string `yaml:"product"`
OSTreeRefTmpl string `yaml:"ostree_ref_tmpl"`
Runner runner.RunnerConf `yaml:"runner"`
// ISOLabelTmpl can contain {{.Product}},{{.OsVersion}},{{.Arch}},{{.ISOLabel}}
ISOLabelTmpl string `yaml:"iso_label_tmpl"`
DefaultFSType disk.FSType `yaml:"default_fs_type"`
// directory with the actual image defintions, we separate that
// so that we can point the "centos-10" distro to the "./rhel-10"
// image types file/directory.
DefsPath string `yaml:"defs_path"`
BootstrapContainers map[arch.Arch]string `yaml:"bootstrap_containers"`
OscapProfilesAllowList []oscap.Profile `yaml:"oscap_profiles_allowlist"`
// ignore the given image types
Conditions map[string]distroConditions `yaml:"conditions"`
// XXX: remove this in favor of a better abstraction, this
// is currently needed because the manifest pkg has conditionals
// based on the distro, ideally it would not have this but
// here we are.
DistroLike manifest.Distro `yaml:"distro_like"`
// contains filtered or unexported fields
}
func NewDistroYAML ¶
func NewDistroYAML(nameVer string) (*DistroYAML, error)
NewDistroYAML return the given distro or nil if the distro is not found. This mimics the "distrofactory.GetDistro() interface.
Note that eventually we want something like "Distros()" instead that returns all known distros but for now we keep compatibility with the way distrofactory/reporegistry work which is by defining distros via repository files.
func (*DistroYAML) ImageConfig ¶
func (d *DistroYAML) ImageConfig() *distro.ImageConfig
ImageConfig returns the distro wide default ImageConfig.
Each ImageType gets this as their default ImageConfig.
func (*DistroYAML) ImageTypes ¶
func (d *DistroYAML) ImageTypes() map[string]ImageTypeYAML
func (*DistroYAML) SkipImageType ¶ added in v0.164.0
func (d *DistroYAML) SkipImageType(imgTypeName, archName string) bool
type ImageTypeYAML ¶
type ImageTypeYAML struct {
// This maps "pkgsKey" to their package sets. The
// map key here is a string that can either be:
// - "os": packages for the os
// - "installer": packages for the installer
// - "container": extra package into an iot container
//
// - "blueprint": unused AFAICT
// - "build": unused AFAICT
// Note that this does not directly maps to pipeline names
// but we should look into making it so.
PackageSetsYAML map[string][]packageSet `yaml:"package_sets"`
// archStr->partitionTable
PartitionTables map[string]*disk.PartitionTable `yaml:"partition_table"`
// override specific aspects of the partition table
PartitionTablesOverrides *partitionTablesOverrides `yaml:"partition_tables_override"`
ImageConfigYAML imageConfig `yaml:"image_config,omitempty"`
InstallerConfigYAML installerConfig `yaml:"installer_config,omitempty"`
Filename string `yaml:"filename"`
MimeType string `yaml:"mime_type"`
Compression string `yaml:"compression"`
Environment environment.EnvironmentConf `yaml:"environment"`
Bootable bool `yaml:"bootable"`
BootISO bool `yaml:"boot_iso"`
// XXX merge with BootISO above, controls if grub2 or syslinux are used for ISO boots
UseSyslinux bool `yaml:"use_syslinux"`
UseLegacyAnacondaConfig bool `yaml:"use_legacy_anaconda_config"`
ISOLabel string `yaml:"iso_label"`
// XXX: or iso_variant?
Variant string `yaml:"variant"`
RPMOSTree bool `yaml:"rpm_ostree"`
OSTree struct {
Name string `yaml:"name"`
RemoteName string `yaml:"remote_name"`
} `yaml:"ostree"`
// XXX: rhel-8 uses this
UseOstreeRemotes bool `yaml:"use_ostree_remotes"`
DefaultSize uint64 `yaml:"default_size"`
// the image func name: disk,container,live-installer,...
Image string `yaml:"image_func"`
BuildPipelines []string `yaml:"build_pipelines"`
PayloadPipelines []string `yaml:"payload_pipelines"`
Exports []string `yaml:"exports"`
RequiredPartitionSizes map[string]uint64 `yaml:"required_partition_sizes"`
InternalPlatforms []platform.PlatformConf `yaml:"platforms"`
PlatformsOverride *platformsOverride `yaml:"platforms_override"`
NameAliases []string `yaml:"name_aliases"`
InstallWeakDeps *bool `yaml:"install_weak_deps"`
// for RHEL7 compat
// TODO: determine a better place for these options, but for now they are here
DiskImagePartTool *osbuild.PartTool `yaml:"disk_image_part_tool"`
DiskImageVPCForceSize *bool `yaml:"disk_image_vpc_force_size"`
SupportedPartitioningModes []disk.PartitioningMode `yaml:"supported_partitioning_modes"`
// contains filtered or unexported fields
}
func (*ImageTypeYAML) ImageConfig ¶
func (imgType *ImageTypeYAML) ImageConfig(distroNameVer, archName string) (*distro.ImageConfig, error)
ImageConfig returns the image type specific ImageConfig
func (*ImageTypeYAML) InstallerConfig ¶
func (imgType *ImageTypeYAML) InstallerConfig(distroNameVer, archName string) (*distro.InstallerConfig, error)
InstallerConfig returns the InstallerConfig for the given imgType Note that on conditions the InstallerConfig is fully replaced, do any merging in YAML
func (*ImageTypeYAML) Name ¶
func (it *ImageTypeYAML) Name() string
func (*ImageTypeYAML) PackageSets ¶
func (imgType *ImageTypeYAML) PackageSets(distroNameVer, archName string) (map[string]rpmmd.PackageSet, error)
PackageSets loads the PackageSets from the yaml source file discovered via the imagetype.
func (*ImageTypeYAML) PartitionTable ¶
func (imgType *ImageTypeYAML) PartitionTable(distroNameVer, archName string) (*disk.PartitionTable, error)
PartitionTable returns the partionTable for the given distro/imgType.
func (*ImageTypeYAML) PlatformsFor ¶ added in v0.165.0
func (it *ImageTypeYAML) PlatformsFor(distroNameVer string) ([]platform.PlatformConf, error)