util: distro, engine: resources: Update virt-builder res
A little easier to maintain if we support more distros eventually.
This commit is contained in:
@@ -71,6 +71,18 @@ var (
|
||||
"PackageKit",
|
||||
},
|
||||
}
|
||||
|
||||
// MapDistroToGuestfsPackages is a map of distro to packages needed to
|
||||
// run the virt-builder software and guestfs suite.
|
||||
MapDistroToGuestfsPackages = map[string][]string{
|
||||
// TODO: add more values
|
||||
DistroDebian: {
|
||||
"guestfs-tools",
|
||||
},
|
||||
DistroFedora: {
|
||||
"guestfs-tools",
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
// DistroToBootstrapPackages returns the list of packages corresponding to the
|
||||
@@ -80,6 +92,14 @@ func DistroToBootstrapPackages(distro string) ([]string, bool) {
|
||||
return l, exists
|
||||
}
|
||||
|
||||
// DistroToGuestfsPackages returns the list of packages corresponding to the
|
||||
// distro for running the virt-builder software and guestfs suite. This returns
|
||||
// false if the value doesn't exist.
|
||||
func DistroToGuestfsPackages(distro string) ([]string, bool) {
|
||||
l, exists := MapDistroToGuestfsPackages[distro]
|
||||
return l, exists
|
||||
}
|
||||
|
||||
// Family returns the distro family.
|
||||
func Family(ctx context.Context) (string, error) {
|
||||
if b, err := IsFamilyRedHat(ctx); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user