mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-06 07:57:35 +00:00
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:
committed by
Clayton Coleman
parent
64b4967774
commit
e3af3451c8
@@ -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 }
|
||||
|
||||
Reference in New Issue
Block a user