@@ -418,7 +418,7 @@ func (t *thirdPartyResourceDataDecoder) Decode(data []byte, gvk *unversioned.Gro
|
|||||||
return nil, nil, fmt.Errorf("unexpected object for 'kind': %v", kindObj)
|
return nil, nil, fmt.Errorf("unexpected object for 'kind': %v", kindObj)
|
||||||
}
|
}
|
||||||
if len(t.kind) > 0 && kindStr != t.kind {
|
if len(t.kind) > 0 && kindStr != t.kind {
|
||||||
return nil, nil, fmt.Errorf("kind doesn't match, expecting: %s, got %s", gvk.Kind, kindStr)
|
return nil, nil, fmt.Errorf("kind doesn't match, expecting: %s, got %s", t.kind, kindStr)
|
||||||
}
|
}
|
||||||
actual.Kind = kindStr
|
actual.Kind = kindStr
|
||||||
}
|
}
|
||||||
|
@@ -80,6 +80,15 @@ func TestCodec(t *testing.T) {
|
|||||||
},
|
},
|
||||||
name: "basic",
|
name: "basic",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
into: &extensions.ThirdPartyResourceData{},
|
||||||
|
obj: &Foo{
|
||||||
|
ObjectMeta: api.ObjectMeta{Name: "bar"},
|
||||||
|
TypeMeta: unversioned.TypeMeta{Kind: "ThirdPartyResourceData"},
|
||||||
|
},
|
||||||
|
expectErr: true,
|
||||||
|
name: "broken kind",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
obj: &Foo{
|
obj: &Foo{
|
||||||
ObjectMeta: api.ObjectMeta{Name: "bar", ResourceVersion: "baz"},
|
ObjectMeta: api.ObjectMeta{Name: "bar", ResourceVersion: "baz"},
|
||||||
|
Reference in New Issue
Block a user