fix: ignore absent extensions SBOM directory

Do not log errors when running without system extensions

Signed-off-by: Dmitrii Sharshakov <dmitry.sharshakov@siderolabs.com>
This commit is contained in:
Dmitrii Sharshakov 2025-07-17 10:12:04 +02:00
parent 9920da3e1a
commit 3f35b83ae3
No known key found for this signature in database
GPG Key ID: 9866BBFAF691F3AF

View File

@ -7,6 +7,7 @@ package runtime
import ( import (
"context" "context"
"encoding/json" "encoding/json"
"errors"
"fmt" "fmt"
"os" "os"
"path/filepath" "path/filepath"
@ -72,6 +73,11 @@ func (ctrl *SBOMItemController) Run(ctx context.Context, r controller.Runtime, l
{true, ctrl.ExtensionSPDXPath}, {true, ctrl.ExtensionSPDXPath},
} { } {
if err := ctrl.processSPDXDirectory(ctx, r, logger, spec.path, spec.isExtension); err != nil { 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 return err
} }
} }