From 873412ac05584d19aec2d069706ee5674e1065c9 Mon Sep 17 00:00:00 2001 From: Federico Di Pierro Date: Thu, 31 Aug 2023 12:12:23 +0200 Subject: [PATCH] fix(pkg): if lastRun distro is empty, we don't need to convert it to a driverkit distro. We will need to run on any supported distro. Signed-off-by: Federico Di Pierro --- pkg/generate/generate.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pkg/generate/generate.go b/pkg/generate/generate.go index 298b076..a272f76 100644 --- a/pkg/generate/generate.go +++ b/pkg/generate/generate.go @@ -80,10 +80,13 @@ func autogenerateConfigs(opts Options) error { } slog.Debug("loaded last-distro", "distro", lastDistro) - // Map back the kernel crawler distro to our internal driverkit distro - opts.Distro = root.ToDriverkitDistro(root.KernelCrawlerDistro(lastDistro)).String() - if opts.Distro == "" { - return fmt.Errorf("kernel-crawler last run distro '%s' unsupported.\n", lastDistro) + // If lastDistro is empty it means we need to run on all supported distros; this is done automatically. + if lastDistro != "" { + // Map back the kernel crawler distro to our internal driverkit distro + opts.Distro = root.ToDriverkitDistro(root.KernelCrawlerDistro(lastDistro)).String() + if opts.Distro == "" { + return fmt.Errorf("kernel-crawler last run distro '%s' unsupported.\n", lastDistro) + } } }