Skip to content

Commit e496f9b

Browse files
committed
Add support for disambiguating multiple responses for cache exporters
by adding IDs similar to output exporters. Signed-off-by: a-palchikov <[email protected]>
1 parent de27ebe commit e496f9b

File tree

9 files changed

+294
-550
lines changed

9 files changed

+294
-550
lines changed

api/services/control/control.pb.go

Lines changed: 24 additions & 393 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/services/control/control.proto

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ message CacheOptionsEntry {
104104
// Attrs are like mode=(min,max), ref=example.com:5000/foo/bar .
105105
// See cache importer/exporter implementations' documentation.
106106
map<string, string> Attrs = 2;
107+
// ID identifies this exporter.
108+
// ID should be treated by the exporter as opaque.
109+
string ID = 3;
107110
}
108111

109112
message SolveResponse {

api/services/control/control_vtproto.pb.go

Lines changed: 47 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/client_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2687,7 +2687,7 @@ func testSessionExporter(t *testing.T, sb integration.Sandbox) {
26872687
require.Equal(t, "foo", resp.Entries[1].Path)
26882688

26892689
exporterCalled = true
2690-
target.Add(filesync.WithFSSync(0, fixedWriteCloser(nopWriteCloser{outW})))
2690+
target.Add(filesync.WithFSSync("0", fixedWriteCloser(nopWriteCloser{outW})))
26912691
return []*exporter.ExporterRequest{
26922692
{
26932693
Type: ExporterOCI,

0 commit comments

Comments
 (0)