mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-27 05:38:06 +08:00
buildflags: fix ref only format for command line and bake
Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
(cherry picked from commit 11c84973ef
)
This commit is contained in:

committed by
Tonis Tiigi

parent
bd7090b981
commit
d5ad869033
@@ -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