Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion frontend/attestations/sbom/sbom.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"encoding/json"
"fmt"
"path"
"runtime"
"strings"

intoto "github.com/in-toto/in-toto-golang/in_toto"
Expand Down Expand Up @@ -84,7 +85,9 @@ func CreateSBOMScanner(ctx context.Context, resolver sourceresolver.MetaResolver
}

runscan := llb.Image(scanner).Run(runOpts...)
runscan.AddMount("/tmp", llb.Scratch(), llb.Tmpfs())
if runtime.GOOS != "windows" {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's not use runtime, we created integration.UnixOrWindows() for this. I'd suggest something like this:

integration.UnixOrWindows(
	runscan.AddMount("/tmp", llb.Scratch(), llb.Tmpfs()),
	runscan.AddMount("/tmp", llb.Scratch()),
)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, updated

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually this is not good. /testutil/integration should only be used in the tests, not in this frontend code.

Copy link
Author

@olljanat olljanat Jul 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I was thinking same but do you want it to be moved example to /util/… in this PR or refactor it later?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops, I thought this was a test. Must just been my foggy brain. If that's the case then your original code was correct, please revert and I approve.

Really sorry for going around...

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert and then just add Tonis' recommendation on using a cache mount. I think other than doing a TODO, let's do it within this PR...

runscan.AddMount("/tmp", llb.Scratch(), llb.Tmpfs())
}

runscan.AddMount(path.Join(srcDir, "core", CoreSBOMName), ref, llb.Readonly)
for k, extra := range extras {
Expand Down
Loading