ObjectMeta, ListMeta, and TypeMeta should implement their interfaces

Make unversioned.ListMeta implement List. Update all the *List types so they implement GetListMeta.
This helps avoid using reflection to get list information.

Remove all unnecessary boilerplate, move the interfaces to the right
places, and add a test that verifies that objects implement one, the
other, but never both.
This commit is contained in:
Andy Goldstein
2016-05-26 14:17:14 -04:00
committed by Clayton Coleman
parent 64b4967774
commit e3af3451c8
25 changed files with 237 additions and 254 deletions

View File

@@ -48,7 +48,3 @@ func addKnownTypes(scheme *runtime.Scheme) {
&LocalSubjectAccessReview{},
)
}
func (obj *LocalSubjectAccessReview) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
func (obj *SubjectAccessReview) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
func (obj *SelfSubjectAccessReview) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }