mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-10 13:37:08 +08:00
buildflags: fix ref only format for command line and bake
Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
This commit is contained in:
@ -37,7 +37,7 @@ func TestCacheOptions_DerivedVars(t *testing.T) {
|
||||
"session_token": "not_a_mitm_attack",
|
||||
},
|
||||
},
|
||||
}, cacheFrom)
|
||||
}, cacheFrom.ToPB())
|
||||
}
|
||||
|
||||
func TestCacheOptions(t *testing.T) {
|
||||
@ -109,3 +109,12 @@ func TestCacheOptions(t *testing.T) {
|
||||
require.True(t, result.True())
|
||||
})
|
||||
}
|
||||
|
||||
func TestCacheOptions_RefOnlyFormat(t *testing.T) {
|
||||
opts, err := ParseCacheEntry([]string{"ref1", "ref2"})
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, CacheOptions{
|
||||
{Type: "registry", Attrs: map[string]string{"ref": "ref1"}},
|
||||
{Type: "registry", Attrs: map[string]string{"ref": "ref2"}},
|
||||
}, opts)
|
||||
}
|
||||
|
Reference in New Issue
Block a user