Documentation
¶
Index ¶
- func DetermineLinuxDistroVersion(distro Distro, release string) string
- func DetermineOS(imageOS string) (OSType, Distro)
- func DetermineOSDetails(imageOS, imageRelease string) (OSType, Distro, string)
- func GetOSQemuCompatibility(osType OSType, distro Distro, distroVersion string) (bool, bool, []string)
- func MapWindowsVersionToAbbrev(version string) (string, error)
- func ToWindowsVersion(imageRelease string) (string, error)
- func ValidateWindowsVersion(v string) error
- type Distro
- type OSType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DetermineLinuxDistroVersion ¶
DetermineLinuxDistroVersion returns the distribution release version from the image.release value.
func DetermineOS ¶
DetermineOS returns the OS type from the image.os value.
func DetermineOSDetails ¶
DetermineOSDetails returns the OS type, distribution, and version from the given image.os and image.release values.
func GetOSQemuCompatibility ¶
func GetOSQemuCompatibility(osType OSType, distro Distro, distroVersion string) (bool, bool, []string)
GetOSQemuCompatibility returns whether the given OS details support various modern qemu features.
func MapWindowsVersionToAbbrev ¶
MapWindowsVersionToAbbrev takes a full version string and returns the abbreviation used by virtio-win drivers.
func ToWindowsVersion ¶
ToWindowsVersion returns the windows version for the given OS description.
func ValidateWindowsVersion ¶
ValidateWindowsVersion checks if the given Windows version is valid.
Types ¶
type Distro ¶
type Distro string
Distro represents an OS distribution.
const ( // AlmaLinux represents an Alma Linux distribution. AlmaLinux Distro = "alma" // AmazonLinux represents an Amazon Linux distribution. AmazonLinux Distro = "amazon" // ArchLinux represents an Arch Linux distribution. ArchLinux Distro = "arch" // CentOSLinux represents a CentOS Linux distribution. CentOSLinux Distro = "centos" // DebianLinux represents a Debian Linux distribution. DebianLinux Distro = "debian" // FedoraLinux represents a Fedora Linux distribution. FedoraLinux Distro = "fedora" // OracleLinux represents an Oracle Linux distribution. OracleLinux Distro = "oracle" // RedHatLinux represents a RedHat Enterprise Linux distribution. RedHatLinux Distro = "rhel" // RockyLinux represents a Rocky Linux distribution. RockyLinux Distro = "rocky" // SUSELinux represents OpenSUSE/SLES Linux distributions. SUSELinux Distro = "suse" // UbuntuLinux represents an Ubuntu Linux distribution. UbuntuLinux Distro = "ubuntu" // OtherDistro represents all other distributions, or OSTypes without a distribution concept. OtherDistro Distro = "other" )
func DetermineLinuxDistro ¶
DetermineLinuxDistro returns the Linux distribution from the image.os value.
func (Distro) IsRHELDerivative ¶
IsRHELDerivative returns whether the given distro is a RHEL derivative.
type OSType ¶
type OSType string
OSType represents an OS type (windows, linux, macos, bsd).
const ( // Windows represents the Windows OS type. Windows OSType = "windows" // Linux represents the Linux OS type. Linux OSType = "linux" // FreeBSD represents the FreeBSD OS type. FreeBSD OSType = "freebsd" // MacOS represents the macOS OS type. MacOS OSType = "macos" // UnknownOS represents all other OS types. UnknownOS OSType = "unknown" )