mirror of
https://github.com/docker/buildx.git
synced 2024-11-22 15:37:16 +08:00
bake: merge cache-from field from compose and x-bake
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
parent
b438032a60
commit
a0f92829a7
@ -190,7 +190,7 @@ func (t *Target) composeExtTarget(exts map[string]interface{}) error {
|
||||
t.Tags = append(t.Tags, xb.Tags...)
|
||||
}
|
||||
if len(xb.CacheFrom) > 0 {
|
||||
t.CacheFrom = xb.CacheFrom // override main field
|
||||
t.CacheFrom = append(t.CacheFrom, xb.CacheFrom...)
|
||||
}
|
||||
if len(xb.CacheTo) > 0 {
|
||||
t.CacheTo = append(t.CacheTo, xb.CacheTo...)
|
||||
|
@ -305,7 +305,7 @@ services:
|
||||
require.Equal(t, c.Targets[0].Args, map[string]string{"CT_ECR": "foo", "CT_TAG": "bar"})
|
||||
require.Equal(t, c.Targets[0].Tags, []string{"ct-addon:baz", "ct-addon:foo", "ct-addon:alp"})
|
||||
require.Equal(t, c.Targets[0].Platforms, []string{"linux/amd64", "linux/arm64"})
|
||||
require.Equal(t, c.Targets[0].CacheFrom, []string{"type=local,src=path/to/cache"})
|
||||
require.Equal(t, c.Targets[0].CacheFrom, []string{"user/app:cache", "type=local,src=path/to/cache"})
|
||||
require.Equal(t, c.Targets[0].CacheTo, []string{"user/app:cache", "type=local,dest=path/to/cache"})
|
||||
require.Equal(t, c.Targets[0].Pull, newBool(true))
|
||||
require.Equal(t, c.Targets[1].Tags, []string{"ct-fake-aws:bar"})
|
||||
|
Loading…
Reference in New Issue
Block a user