File tree Expand file tree Collapse file tree 16 files changed +5
-65
lines changed
cmd/libs/go2idl/client-gen/test_apis/testgroup
controller/garbagecollector/metaonly Expand file tree Collapse file tree 16 files changed +5
-65
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,3 @@ func addKnownTypes(scheme *runtime.Scheme) error {
3838 scheme .AddKnownTypes (SchemeGroupVersion )
3939 return nil
4040}
41-
42- func (obj * TestType ) GetObjectKind () schema.ObjectKind { return & obj .TypeMeta }
43- func (obj * TestTypeList ) GetObjectKind () schema.ObjectKind { return & obj .TypeMeta }
Original file line number Diff line number Diff line change @@ -52,6 +52,3 @@ func addKnownTypes(scheme *runtime.Scheme) error {
5252 metav1 .AddToGroupVersion (scheme , SchemeGroupVersion )
5353 return nil
5454}
55-
56- func (obj * TestType ) GetObjectKind () schema.ObjectKind { return & obj .TypeMeta }
57- func (obj * TestTypeList ) GetObjectKind () schema.ObjectKind { return & obj .TypeMeta }
Original file line number Diff line number Diff line change @@ -35,8 +35,6 @@ type ExtensionAPIObject struct {
3535 metav1.ObjectMeta
3636}
3737
38- func (obj * ExtensionAPIObject ) GetObjectKind () schema.ObjectKind { return & obj .TypeMeta }
39-
4038func TestGetReference (t * testing.T ) {
4139
4240 // when vendoring kube, if you don't force the set of registered versions (like make test does)
Original file line number Diff line number Diff line change @@ -60,5 +60,3 @@ func addKnownTypes(scheme *runtime.Scheme) error {
6060 )
6161 return nil
6262}
63-
64- func (obj * Policy ) GetObjectKind () schema.ObjectKind { return & obj .TypeMeta }
Original file line number Diff line number Diff line change @@ -60,5 +60,3 @@ func addKnownTypes(scheme *runtime.Scheme) error {
6060 )
6161 return nil
6262}
63-
64- func (obj * Policy ) GetObjectKind () schema.ObjectKind { return & obj .TypeMeta }
Original file line number Diff line number Diff line change @@ -27,9 +27,6 @@ import (
2727 "k8s.io/kubernetes/pkg/api"
2828)
2929
30- func (obj * MetadataOnlyObject ) GetObjectKind () schema.ObjectKind { return obj }
31- func (obj * MetadataOnlyObjectList ) GetObjectKind () schema.ObjectKind { return obj }
32-
3330type metaOnlyJSONScheme struct {}
3431
3532// This function can be extended to mapping different gvk to different MetadataOnlyObject,
Original file line number Diff line number Diff line change @@ -18,7 +18,6 @@ go_library(
1818 deps = [
1919 "//vendor/github.com/ugorji/go/codec:go_default_library" ,
2020 "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library" ,
21- "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library" ,
2221 "//vendor/k8s.io/apimachinery/pkg/types:go_default_library" ,
2322 ],
2423)
Original file line number Diff line number Diff line change @@ -18,7 +18,6 @@ package testing
1818
1919import (
2020 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
21- "k8s.io/apimachinery/pkg/runtime/schema"
2221)
2322
2423type TestStruct struct {
@@ -30,5 +29,3 @@ type TestStruct struct {
3029 StringList []string `json:"StringList"`
3130 IntList []int `json:"IntList"`
3231}
33-
34- func (obj * TestStruct ) GetObjectKind () schema.ObjectKind { return & obj .TypeMeta }
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ func (obj *TypeMeta) GroupVersionKind() schema.GroupVersionKind {
2828 return schema .FromAPIVersionAndKind (obj .APIVersion , obj .Kind )
2929}
3030
31- func (obj * Unknown ) GetObjectKind () schema.ObjectKind { return & obj . TypeMeta }
31+ func (obj * TypeMeta ) GetObjectKind () schema.ObjectKind { return obj }
3232
3333// GetObjectKind implements Object for VersionedObjects, returning an empty ObjectKind
3434// interface if no objects are provided, or the ObjectKind interface of the object in the
Original file line number Diff line number Diff line change @@ -441,15 +441,10 @@ func TestAddKnownTypesIdemPotent(t *testing.T) {
441441 }
442442}
443443
444- // EmbeddableTypeMeta passes GetObjectKind to the type which embeds it.
445- type EmbeddableTypeMeta runtime.TypeMeta
446-
447- func (tm * EmbeddableTypeMeta ) GetObjectKind () schema.ObjectKind { return (* runtime .TypeMeta )(tm ) }
448-
449444// redefine InternalSimple with the same name, but obviously as a different type than in runtimetesting
450445type InternalSimple struct {
451- EmbeddableTypeMeta `json:",inline"`
452- TestString string `json:"testString"`
446+ runtime. TypeMeta `json:",inline"`
447+ TestString string `json:"testString"`
453448}
454449
455450func (s * InternalSimple ) DeepCopyObject () runtime.Object { return nil }
You can’t perform that action at this time.
0 commit comments