From 468a036e8a010e8a94cb12e01137c5d2e0db6d66 Mon Sep 17 00:00:00 2001 From: "Dr. Stefan Schimanski" Date: Thu, 9 Nov 2017 12:27:06 +0100 Subject: [PATCH 1/3] apimachinery: Remove cloner from scheme Kubernetes-commit: b5b62c68318be79a665257c260ea9f9bbb6d6318 --- pkg/apiserver/customresource_handler.go | 1 - 1 file changed, 1 deletion(-) diff --git a/pkg/apiserver/customresource_handler.go b/pkg/apiserver/customresource_handler.go index 447068444..773a06577 100644 --- a/pkg/apiserver/customresource_handler.go +++ b/pkg/apiserver/customresource_handler.go @@ -309,7 +309,6 @@ func (r *crdHandler) getServingInfoFor(crd *apiextensions.CustomResourceDefiniti &metav1.GetOptions{}, &metav1.DeleteOptions{}, ) - parameterScheme.AddGeneratedDeepCopyFuncs(metav1.GetGeneratedDeepCopyFuncs()...) parameterCodec := runtime.NewParameterCodec(parameterScheme) kind := schema.GroupVersionKind{Group: crd.Spec.Group, Version: crd.Spec.Version, Kind: crd.Status.AcceptedNames.Kind} From 9e49d0789221e71ce9c14a9c9599a327c0e871e1 Mon Sep 17 00:00:00 2001 From: "Dr. Stefan Schimanski" Date: Thu, 9 Nov 2017 12:40:14 +0100 Subject: [PATCH 2/3] deepcopy: remove deepcopy register tags Kubernetes-commit: 72809a08b94650bc8988db37be3a2ee4c6ccd113 --- examples/client-go/pkg/apis/cr/v1/doc.go | 2 +- pkg/apis/apiextensions/doc.go | 2 +- pkg/apis/apiextensions/v1beta1/doc.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/client-go/pkg/apis/cr/v1/doc.go b/examples/client-go/pkg/apis/cr/v1/doc.go index 97e36b183..73d79a45d 100644 --- a/examples/client-go/pkg/apis/cr/v1/doc.go +++ b/examples/client-go/pkg/apis/cr/v1/doc.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// +k8s:deepcopy-gen=package,register +// +k8s:deepcopy-gen=package // Package v1 is the v1 version of the API. // +groupName=cr.example.apiextensions.k8s.io diff --git a/pkg/apis/apiextensions/doc.go b/pkg/apis/apiextensions/doc.go index d3b8f8db4..0517ec6a8 100644 --- a/pkg/apis/apiextensions/doc.go +++ b/pkg/apis/apiextensions/doc.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// +k8s:deepcopy-gen=package,register +// +k8s:deepcopy-gen=package // Package apiextensions is the internal version of the API. // +groupName=apiextensions.k8s.io diff --git a/pkg/apis/apiextensions/v1beta1/doc.go b/pkg/apis/apiextensions/v1beta1/doc.go index 67af169a1..50ab2b54c 100644 --- a/pkg/apis/apiextensions/v1beta1/doc.go +++ b/pkg/apis/apiextensions/v1beta1/doc.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// +k8s:deepcopy-gen=package,register +// +k8s:deepcopy-gen=package // +k8s:conversion-gen=k8s.io/apiextensions-apiserver/pkg/apis/apiextensions // +k8s:defaulter-gen=TypeMeta From 9e9d60d14567d0a01ae3e558a29547f0a7bed442 Mon Sep 17 00:00:00 2001 From: "Dr. Stefan Schimanski" Date: Thu, 9 Nov 2017 12:27:20 +0100 Subject: [PATCH 3/3] Update generated code Kubernetes-commit: 1e79dfb959896f2e51be87ecef491452bd17724c --- examples/client-go/pkg/apis/cr/v1/BUILD | 1 - .../pkg/apis/cr/v1/zz_generated.deepcopy.go | 31 --------- pkg/apis/apiextensions/BUILD | 1 - .../v1beta1/zz_generated.deepcopy.go | 67 ------------------- .../apiextensions/zz_generated.deepcopy.go | 63 ----------------- 5 files changed, 163 deletions(-) diff --git a/examples/client-go/pkg/apis/cr/v1/BUILD b/examples/client-go/pkg/apis/cr/v1/BUILD index 614c7ecd1..0379da4b1 100644 --- a/examples/client-go/pkg/apis/cr/v1/BUILD +++ b/examples/client-go/pkg/apis/cr/v1/BUILD @@ -17,7 +17,6 @@ go_library( deps = [ "//vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/apis/cr:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/conversion:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", ], diff --git a/examples/client-go/pkg/apis/cr/v1/zz_generated.deepcopy.go b/examples/client-go/pkg/apis/cr/v1/zz_generated.deepcopy.go index e285b3781..fe626ef90 100644 --- a/examples/client-go/pkg/apis/cr/v1/zz_generated.deepcopy.go +++ b/examples/client-go/pkg/apis/cr/v1/zz_generated.deepcopy.go @@ -21,40 +21,9 @@ limitations under the License. package v1 import ( - conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" - reflect "reflect" ) -func init() { - SchemeBuilder.Register(RegisterDeepCopies) -} - -// RegisterDeepCopies adds deep-copy functions to the given scheme. Public -// to allow building arbitrary schemes. -// -// Deprecated: deepcopy registration will go away when static deepcopy is fully implemented. -func RegisterDeepCopies(scheme *runtime.Scheme) error { - return scheme.AddGeneratedDeepCopyFuncs( - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*Example).DeepCopyInto(out.(*Example)) - return nil - }, InType: reflect.TypeOf(&Example{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*ExampleList).DeepCopyInto(out.(*ExampleList)) - return nil - }, InType: reflect.TypeOf(&ExampleList{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*ExampleSpec).DeepCopyInto(out.(*ExampleSpec)) - return nil - }, InType: reflect.TypeOf(&ExampleSpec{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*ExampleStatus).DeepCopyInto(out.(*ExampleStatus)) - return nil - }, InType: reflect.TypeOf(&ExampleStatus{})}, - ) -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Example) DeepCopyInto(out *Example) { *out = *in diff --git a/pkg/apis/apiextensions/BUILD b/pkg/apis/apiextensions/BUILD index 3dc0a063a..303d94b93 100644 --- a/pkg/apis/apiextensions/BUILD +++ b/pkg/apis/apiextensions/BUILD @@ -20,7 +20,6 @@ go_library( importpath = "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions", deps = [ "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/conversion:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", ], diff --git a/pkg/apis/apiextensions/v1beta1/zz_generated.deepcopy.go b/pkg/apis/apiextensions/v1beta1/zz_generated.deepcopy.go index 6f97eb6db..697f87417 100644 --- a/pkg/apis/apiextensions/v1beta1/zz_generated.deepcopy.go +++ b/pkg/apis/apiextensions/v1beta1/zz_generated.deepcopy.go @@ -21,76 +21,9 @@ limitations under the License. package v1beta1 import ( - conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" - reflect "reflect" ) -func init() { - SchemeBuilder.Register(RegisterDeepCopies) -} - -// RegisterDeepCopies adds deep-copy functions to the given scheme. Public -// to allow building arbitrary schemes. -// -// Deprecated: deepcopy registration will go away when static deepcopy is fully implemented. -func RegisterDeepCopies(scheme *runtime.Scheme) error { - return scheme.AddGeneratedDeepCopyFuncs( - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*CustomResourceDefinition).DeepCopyInto(out.(*CustomResourceDefinition)) - return nil - }, InType: reflect.TypeOf(&CustomResourceDefinition{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*CustomResourceDefinitionCondition).DeepCopyInto(out.(*CustomResourceDefinitionCondition)) - return nil - }, InType: reflect.TypeOf(&CustomResourceDefinitionCondition{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*CustomResourceDefinitionList).DeepCopyInto(out.(*CustomResourceDefinitionList)) - return nil - }, InType: reflect.TypeOf(&CustomResourceDefinitionList{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*CustomResourceDefinitionNames).DeepCopyInto(out.(*CustomResourceDefinitionNames)) - return nil - }, InType: reflect.TypeOf(&CustomResourceDefinitionNames{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*CustomResourceDefinitionSpec).DeepCopyInto(out.(*CustomResourceDefinitionSpec)) - return nil - }, InType: reflect.TypeOf(&CustomResourceDefinitionSpec{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*CustomResourceDefinitionStatus).DeepCopyInto(out.(*CustomResourceDefinitionStatus)) - return nil - }, InType: reflect.TypeOf(&CustomResourceDefinitionStatus{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*CustomResourceValidation).DeepCopyInto(out.(*CustomResourceValidation)) - return nil - }, InType: reflect.TypeOf(&CustomResourceValidation{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*ExternalDocumentation).DeepCopyInto(out.(*ExternalDocumentation)) - return nil - }, InType: reflect.TypeOf(&ExternalDocumentation{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*JSON).DeepCopyInto(out.(*JSON)) - return nil - }, InType: reflect.TypeOf(&JSON{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*JSONSchemaProps).DeepCopyInto(out.(*JSONSchemaProps)) - return nil - }, InType: reflect.TypeOf(&JSONSchemaProps{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*JSONSchemaPropsOrArray).DeepCopyInto(out.(*JSONSchemaPropsOrArray)) - return nil - }, InType: reflect.TypeOf(&JSONSchemaPropsOrArray{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*JSONSchemaPropsOrBool).DeepCopyInto(out.(*JSONSchemaPropsOrBool)) - return nil - }, InType: reflect.TypeOf(&JSONSchemaPropsOrBool{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*JSONSchemaPropsOrStringArray).DeepCopyInto(out.(*JSONSchemaPropsOrStringArray)) - return nil - }, InType: reflect.TypeOf(&JSONSchemaPropsOrStringArray{})}, - ) -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CustomResourceDefinition) DeepCopyInto(out *CustomResourceDefinition) { *out = *in diff --git a/pkg/apis/apiextensions/zz_generated.deepcopy.go b/pkg/apis/apiextensions/zz_generated.deepcopy.go index ae6f2d79f..f7d57c22e 100644 --- a/pkg/apis/apiextensions/zz_generated.deepcopy.go +++ b/pkg/apis/apiextensions/zz_generated.deepcopy.go @@ -21,72 +21,9 @@ limitations under the License. package apiextensions import ( - conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" - reflect "reflect" ) -func init() { - SchemeBuilder.Register(RegisterDeepCopies) -} - -// RegisterDeepCopies adds deep-copy functions to the given scheme. Public -// to allow building arbitrary schemes. -// -// Deprecated: deepcopy registration will go away when static deepcopy is fully implemented. -func RegisterDeepCopies(scheme *runtime.Scheme) error { - return scheme.AddGeneratedDeepCopyFuncs( - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*CustomResourceDefinition).DeepCopyInto(out.(*CustomResourceDefinition)) - return nil - }, InType: reflect.TypeOf(&CustomResourceDefinition{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*CustomResourceDefinitionCondition).DeepCopyInto(out.(*CustomResourceDefinitionCondition)) - return nil - }, InType: reflect.TypeOf(&CustomResourceDefinitionCondition{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*CustomResourceDefinitionList).DeepCopyInto(out.(*CustomResourceDefinitionList)) - return nil - }, InType: reflect.TypeOf(&CustomResourceDefinitionList{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*CustomResourceDefinitionNames).DeepCopyInto(out.(*CustomResourceDefinitionNames)) - return nil - }, InType: reflect.TypeOf(&CustomResourceDefinitionNames{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*CustomResourceDefinitionSpec).DeepCopyInto(out.(*CustomResourceDefinitionSpec)) - return nil - }, InType: reflect.TypeOf(&CustomResourceDefinitionSpec{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*CustomResourceDefinitionStatus).DeepCopyInto(out.(*CustomResourceDefinitionStatus)) - return nil - }, InType: reflect.TypeOf(&CustomResourceDefinitionStatus{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*CustomResourceValidation).DeepCopyInto(out.(*CustomResourceValidation)) - return nil - }, InType: reflect.TypeOf(&CustomResourceValidation{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*ExternalDocumentation).DeepCopyInto(out.(*ExternalDocumentation)) - return nil - }, InType: reflect.TypeOf(&ExternalDocumentation{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*JSONSchemaProps).DeepCopyInto(out.(*JSONSchemaProps)) - return nil - }, InType: reflect.TypeOf(&JSONSchemaProps{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*JSONSchemaPropsOrArray).DeepCopyInto(out.(*JSONSchemaPropsOrArray)) - return nil - }, InType: reflect.TypeOf(&JSONSchemaPropsOrArray{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*JSONSchemaPropsOrBool).DeepCopyInto(out.(*JSONSchemaPropsOrBool)) - return nil - }, InType: reflect.TypeOf(&JSONSchemaPropsOrBool{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*JSONSchemaPropsOrStringArray).DeepCopyInto(out.(*JSONSchemaPropsOrStringArray)) - return nil - }, InType: reflect.TypeOf(&JSONSchemaPropsOrStringArray{})}, - ) -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CustomResourceDefinition) DeepCopyInto(out *CustomResourceDefinition) { *out = *in