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:
@@ -219,7 +219,12 @@ func (obj *VirtBuilderRes) getGuestfs() ([]string, error) {
|
|||||||
// that we can easily run mgmt.
|
// that we can easily run mgmt.
|
||||||
func (obj *VirtBuilderRes) getDeps() ([]string, error) {
|
func (obj *VirtBuilderRes) getDeps() ([]string, error) {
|
||||||
// TODO: Improve this function as things evolve.
|
// 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)
|
packages, exists := distroUtil.ToBootstrapPackages(distro)
|
||||||
if !exists {
|
if !exists {
|
||||||
// TODO: patches welcome!
|
// TODO: patches welcome!
|
||||||
|
|||||||
Reference in New Issue
Block a user