Merge pull request #2583 from tonistiigi/bake-implicit-cacheonly

bake: use cacheonly exporter for implicit targets
This commit is contained in:
Tõnis Tiigi 2024-07-09 12:40:21 -07:00 committed by GitHub
commit dc83501a5b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View File

@ -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
}

View File

@ -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"]