buildflags: fix missing cache type error typo

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2026-07-23 11:20:10 +02:00
parent 4e15a5aca0
commit 83ce7462af
2 changed files with 15 additions and 2 deletions
+13
View File
@@ -86,3 +86,16 @@ func TestCacheOptions_RefOnlyFormat(t *testing.T) {
{Type: "registry", Attrs: map[string]string{"ref": "ref2"}},
}, opts)
}
func TestCacheOptions_MissingTypeError(t *testing.T) {
t.Run("ParseCacheEntry", func(t *testing.T) {
_, err := ParseCacheEntry([]string{"test=test"})
require.EqualError(t, err, `type required for "test=test"`)
})
t.Run("UnmarshalJSON", func(t *testing.T) {
var actual CacheOptionsEntry
err := json.Unmarshal([]byte(`{"ref":"user/app:cache"}`), &actual)
require.EqualError(t, err, `type required for "{\"ref\":\"user/app:cache\"}"`)
})
}