store/json: log on dropping composes on unmarshal

If an invalid compose is encountered, then we drop it. Make sure to log
if a logger object is provided.

Signed-off-by: Tom Gundersen <teg@jklm.no>
This commit is contained in:
Tom Gundersen 2020-05-14 01:34:21 +02:00
parent f8db2e28e1
commit a22cd78eb3
6 changed files with 15 additions and 12 deletions

View file

@ -171,12 +171,12 @@ func Test_newStoreFromV0(t *testing.T) {
storeStruct: storeV0{},
arch: &test_distro.TestArch{},
},
want: New(nil, &test_distro.TestArch{}),
want: New(nil, &test_distro.TestArch{}, nil),
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := newStoreFromV0(tt.args.storeStruct, tt.args.arch); !reflect.DeepEqual(got, tt.want) {
if got := newStoreFromV0(tt.args.storeStruct, tt.args.arch, nil); !reflect.DeepEqual(got, tt.want) {
t.Errorf("newStoreFromV0() = %v, want %v", got, tt.want)
}
})