mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-14 13:45:06 +00:00
@@ -418,7 +418,7 @@ func (t *thirdPartyResourceDataDecoder) Decode(data []byte, gvk *unversioned.Gro
|
||||
return nil, nil, fmt.Errorf("unexpected object for 'kind': %v", kindObj)
|
||||
}
|
||||
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
|
||||
}
|
||||
|
@@ -80,6 +80,15 @@ func TestCodec(t *testing.T) {
|
||||
},
|
||||
name: "basic",
|
||||
},
|
||||
{
|
||||
into: &extensions.ThirdPartyResourceData{},
|
||||
obj: &Foo{
|
||||
ObjectMeta: api.ObjectMeta{Name: "bar"},
|
||||
TypeMeta: unversioned.TypeMeta{Kind: "ThirdPartyResourceData"},
|
||||
},
|
||||
expectErr: true,
|
||||
name: "broken kind",
|
||||
},
|
||||
{
|
||||
obj: &Foo{
|
||||
ObjectMeta: api.ObjectMeta{Name: "bar", ResourceVersion: "baz"},
|
||||
|
Reference in New Issue
Block a user