From 93a1b74e347556dd86eee621a939fc315aee2b34 Mon Sep 17 00:00:00 2001 From: Mikhail Klementev Date: Sun, 14 May 2023 07:19:35 +0000 Subject: [PATCH] feat: add dummy func to list debian kernels --- distro/debian/debian.go | 6 ++++++ kernel/kernel.go | 11 +++++++++++ 2 files changed, 17 insertions(+) diff --git a/distro/debian/debian.go b/distro/debian/debian.go index e298cd2..054af35 100644 --- a/distro/debian/debian.go +++ b/distro/debian/debian.go @@ -11,6 +11,7 @@ import ( "code.dumpstack.io/tools/out-of-tree/cache" "code.dumpstack.io/tools/out-of-tree/config" + "code.dumpstack.io/tools/out-of-tree/container" "code.dumpstack.io/tools/out-of-tree/fs" ) @@ -254,3 +255,8 @@ func ContainerCommands(km config.KernelMask) (commands []string) { return } + +func ContainerKernels(d container.Image, kcfg *config.KernelConfig) (err error) { + err = errors.New("TODO not implemented") + return +} diff --git a/kernel/kernel.go b/kernel/kernel.go index 1133df0..aa4753c 100644 --- a/kernel/kernel.go +++ b/kernel/kernel.go @@ -522,6 +522,17 @@ func UpdateKernelsCfg(host, download bool) (err error) { } for _, d := range dockerImages { + // TODO Requires changing the idea of how we list + // kernels from containers to distro/-related + // functions. + if strings.Contains(d.Name, "debian") { + err = debian.ContainerKernels(d, &newkcfg) + if err != nil { + log.Print("gen kernels", d.Name, ":", err) + } + continue + } + err = listContainersKernels(d, &newkcfg, download) if err != nil { log.Print("gen kernels", d.Name, ":", err)