From 3f35b83ae35a85bb4d31eb93e6848de1b9d92aeb Mon Sep 17 00:00:00 2001 From: Dmitrii Sharshakov Date: Thu, 17 Jul 2025 10:12:04 +0200 Subject: [PATCH] fix: ignore absent extensions SBOM directory Do not log errors when running without system extensions Signed-off-by: Dmitrii Sharshakov --- internal/app/machined/pkg/controllers/runtime/sbom_item.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/app/machined/pkg/controllers/runtime/sbom_item.go b/internal/app/machined/pkg/controllers/runtime/sbom_item.go index 554805824..9df1cbcd5 100644 --- a/internal/app/machined/pkg/controllers/runtime/sbom_item.go +++ b/internal/app/machined/pkg/controllers/runtime/sbom_item.go @@ -7,6 +7,7 @@ package runtime import ( "context" "encoding/json" + "errors" "fmt" "os" "path/filepath" @@ -72,6 +73,11 @@ func (ctrl *SBOMItemController) Run(ctx context.Context, r controller.Runtime, l {true, ctrl.ExtensionSPDXPath}, } { if err := ctrl.processSPDXDirectory(ctx, r, logger, spec.path, spec.isExtension); err != nil { + if spec.isExtension && errors.Is(err, os.ErrNotExist) { + // Extension SBOM directory is only present if extensions are installed + continue + } + return err } }