From e2e3576e142eb681f3aa1596013bff72b54ac2bc Mon Sep 17 00:00:00 2001 From: "Dr. Stefan Schimanski" Date: Thu, 9 Nov 2017 12:40:14 +0100 Subject: [PATCH 1/2] deepcopy: remove deepcopy register tags Kubernetes-commit: 72809a08b94650bc8988db37be3a2ee4c6ccd113 --- pkg/apis/custom_metrics/doc.go | 2 +- pkg/apis/custom_metrics/v1beta1/doc.go | 2 +- pkg/apis/metrics/doc.go | 2 +- pkg/apis/metrics/v1alpha1/doc.go | 2 +- pkg/apis/metrics/v1beta1/doc.go | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/apis/custom_metrics/doc.go b/pkg/apis/custom_metrics/doc.go index 083943d1..73997cac 100644 --- a/pkg/apis/custom_metrics/doc.go +++ b/pkg/apis/custom_metrics/doc.go @@ -14,6 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -// +k8s:deepcopy-gen=package,register +// +k8s:deepcopy-gen=package // +groupName=custom.metrics.k8s.io package custom_metrics diff --git a/pkg/apis/custom_metrics/v1beta1/doc.go b/pkg/apis/custom_metrics/v1beta1/doc.go index b20dfa79..57c08a21 100644 --- a/pkg/apis/custom_metrics/v1beta1/doc.go +++ b/pkg/apis/custom_metrics/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/metrics/pkg/apis/custom_metrics // +k8s:openapi-gen=true diff --git a/pkg/apis/metrics/doc.go b/pkg/apis/metrics/doc.go index 548724f3..9437a13f 100644 --- a/pkg/apis/metrics/doc.go +++ b/pkg/apis/metrics/doc.go @@ -14,6 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -// +k8s:deepcopy-gen=package,register +// +k8s:deepcopy-gen=package // +groupName=metrics.k8s.io package metrics diff --git a/pkg/apis/metrics/v1alpha1/doc.go b/pkg/apis/metrics/v1alpha1/doc.go index 76c2b9a7..f870a997 100644 --- a/pkg/apis/metrics/v1alpha1/doc.go +++ b/pkg/apis/metrics/v1alpha1/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/metrics/pkg/apis/metrics // +k8s:openapi-gen=true diff --git a/pkg/apis/metrics/v1beta1/doc.go b/pkg/apis/metrics/v1beta1/doc.go index ec9ac583..2f93e6aa 100644 --- a/pkg/apis/metrics/v1beta1/doc.go +++ b/pkg/apis/metrics/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/metrics/pkg/apis/metrics // +k8s:openapi-gen=true From a915e5cba892c8df03e8f8b9c38c238ad6f8fda0 Mon Sep 17 00:00:00 2001 From: "Dr. Stefan Schimanski" Date: Thu, 9 Nov 2017 12:27:20 +0100 Subject: [PATCH 2/2] Update generated code Kubernetes-commit: 1e79dfb959896f2e51be87ecef491452bd17724c --- pkg/apis/custom_metrics/BUILD | 1 - .../v1beta1/zz_generated.deepcopy.go | 23 ------------ .../custom_metrics/zz_generated.deepcopy.go | 27 -------------- pkg/apis/metrics/BUILD | 1 - .../metrics/v1alpha1/zz_generated.deepcopy.go | 35 ------------------- .../metrics/v1beta1/zz_generated.deepcopy.go | 35 ------------------- pkg/apis/metrics/zz_generated.deepcopy.go | 35 ------------------- 7 files changed, 157 deletions(-) diff --git a/pkg/apis/custom_metrics/BUILD b/pkg/apis/custom_metrics/BUILD index b15913ae..93225be6 100644 --- a/pkg/apis/custom_metrics/BUILD +++ b/pkg/apis/custom_metrics/BUILD @@ -17,7 +17,6 @@ go_library( deps = [ "//vendor/k8s.io/apimachinery/pkg/api/resource: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", "//vendor/k8s.io/apimachinery/pkg/types:go_default_library", diff --git a/pkg/apis/custom_metrics/v1beta1/zz_generated.deepcopy.go b/pkg/apis/custom_metrics/v1beta1/zz_generated.deepcopy.go index 5b780052..61590587 100644 --- a/pkg/apis/custom_metrics/v1beta1/zz_generated.deepcopy.go +++ b/pkg/apis/custom_metrics/v1beta1/zz_generated.deepcopy.go @@ -21,32 +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.(*MetricValue).DeepCopyInto(out.(*MetricValue)) - return nil - }, InType: reflect.TypeOf(&MetricValue{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*MetricValueList).DeepCopyInto(out.(*MetricValueList)) - return nil - }, InType: reflect.TypeOf(&MetricValueList{})}, - ) -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *MetricValue) DeepCopyInto(out *MetricValue) { *out = *in diff --git a/pkg/apis/custom_metrics/zz_generated.deepcopy.go b/pkg/apis/custom_metrics/zz_generated.deepcopy.go index c61d3c4c..54641163 100644 --- a/pkg/apis/custom_metrics/zz_generated.deepcopy.go +++ b/pkg/apis/custom_metrics/zz_generated.deepcopy.go @@ -21,36 +21,9 @@ limitations under the License. package custom_metrics 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.(*MetricValue).DeepCopyInto(out.(*MetricValue)) - return nil - }, InType: reflect.TypeOf(&MetricValue{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*MetricValueList).DeepCopyInto(out.(*MetricValueList)) - return nil - }, InType: reflect.TypeOf(&MetricValueList{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*ObjectReference).DeepCopyInto(out.(*ObjectReference)) - return nil - }, InType: reflect.TypeOf(&ObjectReference{})}, - ) -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *MetricValue) DeepCopyInto(out *MetricValue) { *out = *in diff --git a/pkg/apis/metrics/BUILD b/pkg/apis/metrics/BUILD index e4c580d7..0b36e9d3 100644 --- a/pkg/apis/metrics/BUILD +++ b/pkg/apis/metrics/BUILD @@ -17,7 +17,6 @@ go_library( deps = [ "//vendor/k8s.io/apimachinery/pkg/api/resource: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/pkg/apis/metrics/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/metrics/v1alpha1/zz_generated.deepcopy.go index e4223daa..d15c9ce8 100644 --- a/pkg/apis/metrics/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/metrics/v1alpha1/zz_generated.deepcopy.go @@ -22,44 +22,9 @@ package v1alpha1 import ( v1 "k8s.io/api/core/v1" - 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.(*ContainerMetrics).DeepCopyInto(out.(*ContainerMetrics)) - return nil - }, InType: reflect.TypeOf(&ContainerMetrics{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*NodeMetrics).DeepCopyInto(out.(*NodeMetrics)) - return nil - }, InType: reflect.TypeOf(&NodeMetrics{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*NodeMetricsList).DeepCopyInto(out.(*NodeMetricsList)) - return nil - }, InType: reflect.TypeOf(&NodeMetricsList{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*PodMetrics).DeepCopyInto(out.(*PodMetrics)) - return nil - }, InType: reflect.TypeOf(&PodMetrics{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*PodMetricsList).DeepCopyInto(out.(*PodMetricsList)) - return nil - }, InType: reflect.TypeOf(&PodMetricsList{})}, - ) -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ContainerMetrics) DeepCopyInto(out *ContainerMetrics) { *out = *in diff --git a/pkg/apis/metrics/v1beta1/zz_generated.deepcopy.go b/pkg/apis/metrics/v1beta1/zz_generated.deepcopy.go index 3f67eeff..2a0571a9 100644 --- a/pkg/apis/metrics/v1beta1/zz_generated.deepcopy.go +++ b/pkg/apis/metrics/v1beta1/zz_generated.deepcopy.go @@ -22,44 +22,9 @@ package v1beta1 import ( v1 "k8s.io/api/core/v1" - 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.(*ContainerMetrics).DeepCopyInto(out.(*ContainerMetrics)) - return nil - }, InType: reflect.TypeOf(&ContainerMetrics{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*NodeMetrics).DeepCopyInto(out.(*NodeMetrics)) - return nil - }, InType: reflect.TypeOf(&NodeMetrics{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*NodeMetricsList).DeepCopyInto(out.(*NodeMetricsList)) - return nil - }, InType: reflect.TypeOf(&NodeMetricsList{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*PodMetrics).DeepCopyInto(out.(*PodMetrics)) - return nil - }, InType: reflect.TypeOf(&PodMetrics{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*PodMetricsList).DeepCopyInto(out.(*PodMetricsList)) - return nil - }, InType: reflect.TypeOf(&PodMetricsList{})}, - ) -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ContainerMetrics) DeepCopyInto(out *ContainerMetrics) { *out = *in diff --git a/pkg/apis/metrics/zz_generated.deepcopy.go b/pkg/apis/metrics/zz_generated.deepcopy.go index 88b5d0a8..d551298c 100644 --- a/pkg/apis/metrics/zz_generated.deepcopy.go +++ b/pkg/apis/metrics/zz_generated.deepcopy.go @@ -21,44 +21,9 @@ limitations under the License. package metrics 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.(*ContainerMetrics).DeepCopyInto(out.(*ContainerMetrics)) - return nil - }, InType: reflect.TypeOf(&ContainerMetrics{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*NodeMetrics).DeepCopyInto(out.(*NodeMetrics)) - return nil - }, InType: reflect.TypeOf(&NodeMetrics{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*NodeMetricsList).DeepCopyInto(out.(*NodeMetricsList)) - return nil - }, InType: reflect.TypeOf(&NodeMetricsList{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*PodMetrics).DeepCopyInto(out.(*PodMetrics)) - return nil - }, InType: reflect.TypeOf(&PodMetrics{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*PodMetricsList).DeepCopyInto(out.(*PodMetricsList)) - return nil - }, InType: reflect.TypeOf(&PodMetricsList{})}, - ) -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ContainerMetrics) DeepCopyInto(out *ContainerMetrics) { *out = *in