engine: resources: Parse distro properly

I regressed here when patching this. Here's the fix. Would be beautiful
to have hardware to run end-to-end testing on. If you want to sponsor
this, please let me know!
This commit is contained in:
James Shubin
2024-10-30 16:04:01 -04:00
parent 422719c345
commit e4f062b006

View File

@@ -219,7 +219,12 @@ func (obj *VirtBuilderRes) getGuestfs() ([]string, error) {
// that we can easily run mgmt.
func (obj *VirtBuilderRes) getDeps() ([]string, error) {
// TODO: Improve this function as things evolve.
distro := strings.TrimSuffix(obj.OSVersion, "-") // fedora- or debian-
ix := strings.Index(obj.OSVersion, "-") // fedora- or debian-
if ix == -1 {
return nil, fmt.Errorf("os version is not supported")
}
distro := obj.OSVersion[0:ix] // everything before the dash, eg: fedora
packages, exists := distroUtil.ToBootstrapPackages(distro)
if !exists {
// TODO: patches welcome!