Skip to content

Commit

Permalink
bake: use cacheonly exporter for implicit targets
Browse files Browse the repository at this point in the history
Clearing the exporter may result in default export
behavior from the driver.

Signed-off-by: Tonis Tiigi <[email protected]>
  • Loading branch information
tonistiigi committed Jul 9, 2024
1 parent 6807690 commit 6d6adc1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bake/bake.go
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ func (c Config) loadLinks(name string, t *Target, m map[string]*Target, o map[st
if err != nil {
return err
}
t2.Outputs = nil
t2.Outputs = []string{"type=cacheonly"}
t2.linked = true
m[target] = t2
}
Expand Down
3 changes: 2 additions & 1 deletion bake/bake_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,8 @@ func TestReadContextFromTargetChain(t *testing.T) {

mid, ok := m["mid"]
require.True(t, ok)
require.Equal(t, 0, len(mid.Outputs))
require.Equal(t, 1, len(mid.Outputs))
require.Equal(t, "type=cacheonly", mid.Outputs[0])
require.Equal(t, 1, len(mid.Contexts))

base, ok := m["base"]
Expand Down

0 comments on commit 6d6adc1

Please sign in to comment.