diff --git a/cmd/kubeadm/app/apis/kubeadm/doc.go b/cmd/kubeadm/app/apis/kubeadm/doc.go index 227c121c107..0cae5ca1a60 100644 --- a/cmd/kubeadm/app/apis/kubeadm/doc.go +++ b/cmd/kubeadm/app/apis/kubeadm/doc.go @@ -14,5 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ +// +k8s:deepcopy-gen=package,register // +groupName=kubeadm.k8s.io package kubeadm // import "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm" diff --git a/cmd/kubeadm/app/apis/kubeadm/types.go b/cmd/kubeadm/app/apis/kubeadm/types.go index ba986368aee..e8d6cf4460c 100644 --- a/cmd/kubeadm/app/apis/kubeadm/types.go +++ b/cmd/kubeadm/app/apis/kubeadm/types.go @@ -22,6 +22,8 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + type MasterConfiguration struct { metav1.TypeMeta @@ -86,6 +88,8 @@ type Etcd struct { Image string } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + type NodeConfiguration struct { metav1.TypeMeta diff --git a/cmd/kubeadm/app/apis/kubeadm/v1alpha1/doc.go b/cmd/kubeadm/app/apis/kubeadm/v1alpha1/doc.go index 0da2cf479a1..4609a57d9eb 100644 --- a/cmd/kubeadm/app/apis/kubeadm/v1alpha1/doc.go +++ b/cmd/kubeadm/app/apis/kubeadm/v1alpha1/doc.go @@ -16,4 +16,5 @@ limitations under the License. // +k8s:defaulter-gen=TypeMeta // +groupName=kubeadm.k8s.io +// +k8s:deepcopy-gen=package package v1alpha1 // import "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1alpha1" diff --git a/cmd/kubeadm/app/apis/kubeadm/v1alpha1/types.go b/cmd/kubeadm/app/apis/kubeadm/v1alpha1/types.go index 0962ca93f63..51a6e195228 100644 --- a/cmd/kubeadm/app/apis/kubeadm/v1alpha1/types.go +++ b/cmd/kubeadm/app/apis/kubeadm/v1alpha1/types.go @@ -22,6 +22,8 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + type MasterConfiguration struct { metav1.TypeMeta `json:",inline"` @@ -86,6 +88,8 @@ type Etcd struct { Image string `json:"image"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + type NodeConfiguration struct { metav1.TypeMeta `json:",inline"` diff --git a/cmd/libs/go2idl/client-gen/test_apis/testgroup/doc.go b/cmd/libs/go2idl/client-gen/test_apis/testgroup/doc.go index e2083788712..eea3a05494e 100644 --- a/cmd/libs/go2idl/client-gen/test_apis/testgroup/doc.go +++ b/cmd/libs/go2idl/client-gen/test_apis/testgroup/doc.go @@ -14,5 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ +// +k8s:deepcopy-gen=package,register // +groupName=testgroup.k8s.io package testgroup // import "k8s.io/kubernetes/cmd/libs/go2idl/client-gen/test_apis/testgroup" diff --git a/cmd/libs/go2idl/client-gen/test_apis/testgroup/types.go b/cmd/libs/go2idl/client-gen/test_apis/testgroup/types.go index 8e0137348de..82e63e2592b 100644 --- a/cmd/libs/go2idl/client-gen/test_apis/testgroup/types.go +++ b/cmd/libs/go2idl/client-gen/test_apis/testgroup/types.go @@ -19,6 +19,7 @@ package testgroup import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type TestType struct { metav1.TypeMeta @@ -26,6 +27,8 @@ type TestType struct { Status TestTypeStatus } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + type TestTypeList struct { metav1.TypeMeta metav1.ListMeta diff --git a/cmd/libs/go2idl/client-gen/test_apis/testgroup/v1/doc.go b/cmd/libs/go2idl/client-gen/test_apis/testgroup/v1/doc.go index f6ab83e2111..3a6f67a2c96 100644 --- a/cmd/libs/go2idl/client-gen/test_apis/testgroup/v1/doc.go +++ b/cmd/libs/go2idl/client-gen/test_apis/testgroup/v1/doc.go @@ -14,6 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// +k8s:deepcopy-gen=package,register // +k8s:openapi-gen=true // +groupName=testgroup.k8s.io package v1 diff --git a/cmd/libs/go2idl/client-gen/test_apis/testgroup/v1/types.go b/cmd/libs/go2idl/client-gen/test_apis/testgroup/v1/types.go index 96e30452bca..9254874a73e 100644 --- a/cmd/libs/go2idl/client-gen/test_apis/testgroup/v1/types.go +++ b/cmd/libs/go2idl/client-gen/test_apis/testgroup/v1/types.go @@ -19,6 +19,7 @@ package v1 import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type TestType struct { metav1.TypeMeta `json:",inline"` @@ -32,6 +33,8 @@ type TestType struct { Status TestTypeStatus `json:"status,omitempty"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + type TestTypeList struct { metav1.TypeMeta `json:",inline"` // +optional diff --git a/federation/apis/federation/types.go b/federation/apis/federation/types.go index cb15997e3d1..1ef540a9c79 100644 --- a/federation/apis/federation/types.go +++ b/federation/apis/federation/types.go @@ -93,6 +93,7 @@ type ClusterStatus struct { // +genclient=true // +nonNamespaced=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // Information about a registered cluster in a federated kubernetes setup. Clusters are not namespaced and have unique names in the federation. type Cluster struct { @@ -110,6 +111,8 @@ type Cluster struct { Status ClusterStatus } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // A list of all the kubernetes clusters registered to the federation type ClusterList struct { metav1.TypeMeta diff --git a/federation/apis/federation/v1beta1/types.go b/federation/apis/federation/v1beta1/types.go index 7047202aa75..8454a4cd92b 100644 --- a/federation/apis/federation/v1beta1/types.go +++ b/federation/apis/federation/v1beta1/types.go @@ -93,6 +93,7 @@ type ClusterStatus struct { } // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +nonNamespaced=true // Information about a registered cluster in a federated kubernetes setup. Clusters are not namespaced and have unique names in the federation. @@ -111,6 +112,8 @@ type Cluster struct { Status ClusterStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // A list of all the kubernetes clusters registered to the federation type ClusterList struct { metav1.TypeMeta `json:",inline"` diff --git a/hack/.golint_failures b/hack/.golint_failures index fc6cad78dd6..1374c7a5be0 100644 --- a/hack/.golint_failures +++ b/hack/.golint_failures @@ -589,6 +589,7 @@ staging/src/k8s.io/apimachinery/pkg/apis/testapigroup/fuzzer staging/src/k8s.io/apimachinery/pkg/apis/testapigroup/v1 staging/src/k8s.io/apimachinery/pkg/conversion staging/src/k8s.io/apimachinery/pkg/conversion/unstructured +staging/src/k8s.io/apimachinery/pkg/labels staging/src/k8s.io/apimachinery/pkg/openapi staging/src/k8s.io/apimachinery/pkg/runtime/schema staging/src/k8s.io/apimachinery/pkg/runtime/serializer diff --git a/pkg/api/ref/ref_test.go b/pkg/api/ref/ref_test.go index 18042bf2408..2c5be62e046 100644 --- a/pkg/api/ref/ref_test.go +++ b/pkg/api/ref/ref_test.go @@ -29,12 +29,23 @@ import ( type FakeAPIObject struct{} func (obj *FakeAPIObject) GetObjectKind() schema.ObjectKind { return schema.EmptyObjectKind } +func (obj *FakeAPIObject) DeepCopyObject() runtime.Object { + if obj == nil { + return nil + } + clone := *obj + return &clone +} type ExtensionAPIObject struct { metav1.TypeMeta metav1.ObjectMeta } +func (obj *ExtensionAPIObject) DeepCopyObject() runtime.Object { + panic("ExtensionAPIObject does not support DeepCopy") +} + func TestGetReference(t *testing.T) { // when vendoring kube, if you don't force the set of registered versions (like make test does) diff --git a/pkg/api/types.go b/pkg/api/types.go index e7aea27e8e1..6a81d43a81c 100644 --- a/pkg/api/types.go +++ b/pkg/api/types.go @@ -417,6 +417,7 @@ const ( // +genclient=true // +nonNamespaced=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type PersistentVolume struct { metav1.TypeMeta @@ -483,6 +484,8 @@ type PersistentVolumeStatus struct { Reason string } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + type PersistentVolumeList struct { metav1.TypeMeta // +optional @@ -491,6 +494,7 @@ type PersistentVolumeList struct { } // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // PersistentVolumeClaim is a user's request for and claim to a persistent volume type PersistentVolumeClaim struct { @@ -507,6 +511,8 @@ type PersistentVolumeClaim struct { Status PersistentVolumeClaimStatus } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + type PersistentVolumeClaimList struct { metav1.TypeMeta // +optional @@ -1839,6 +1845,8 @@ const ( RestartPolicyNever RestartPolicy = "Never" ) +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // PodList is a list of Pods. type PodList struct { metav1.TypeMeta @@ -2356,6 +2364,8 @@ type PodStatus struct { ContainerStatuses []ContainerStatus } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // PodStatusResult is a wrapper for PodStatus returned by kubelet that can be encode/decoded type PodStatusResult struct { metav1.TypeMeta @@ -2368,6 +2378,7 @@ type PodStatusResult struct { } // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // Pod is a collection of containers, used as either input (create, update) or as output (list, get). type Pod struct { @@ -2397,6 +2408,7 @@ type PodTemplateSpec struct { } // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // PodTemplate describes a template for creating copies of a predefined pod. type PodTemplate struct { @@ -2409,6 +2421,8 @@ type PodTemplate struct { Template PodTemplateSpec } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // PodTemplateList is a list of PodTemplates. type PodTemplateList struct { metav1.TypeMeta @@ -2502,6 +2516,7 @@ type ReplicationControllerCondition struct { } // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // ReplicationController represents the configuration of a replication controller. type ReplicationController struct { @@ -2519,6 +2534,8 @@ type ReplicationController struct { Status ReplicationControllerStatus } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // ReplicationControllerList is a collection of replication controllers. type ReplicationControllerList struct { metav1.TypeMeta @@ -2534,6 +2551,8 @@ const ( ClusterIPNone = "None" ) +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // ServiceList holds a list of services. type ServiceList struct { metav1.TypeMeta @@ -2732,6 +2751,7 @@ type ServicePort struct { } // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // Service is a named abstraction of software service (for example, mysql) consisting of local port // (for example 3306) that the proxy listens on, and the selector that determines which pods @@ -2751,6 +2771,7 @@ type Service struct { } // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // ServiceAccount binds together: // * a name, understood by users, and perhaps by peripheral systems, for an identity @@ -2776,6 +2797,8 @@ type ServiceAccount struct { AutomountServiceAccountToken *bool } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // ServiceAccountList is a list of ServiceAccount objects type ServiceAccountList struct { metav1.TypeMeta @@ -2786,6 +2809,7 @@ type ServiceAccountList struct { } // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // Endpoints is a collection of endpoints that implement the actual service. Example: // Name: "mysvc", @@ -2855,6 +2879,8 @@ type EndpointPort struct { Protocol Protocol } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // EndpointsList is a list of endpoints. type EndpointsList struct { metav1.TypeMeta @@ -3126,6 +3152,7 @@ type ResourceList map[ResourceName]resource.Quantity // +genclient=true // +nonNamespaced=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // Node is a worker node in Kubernetes // The name of the node according to etcd is in ObjectMeta.Name. @@ -3143,6 +3170,8 @@ type Node struct { Status NodeStatus } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // NodeList is a list of nodes. type NodeList struct { metav1.TypeMeta @@ -3186,6 +3215,7 @@ const ( // +genclient=true // +nonNamespaced=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // A namespace provides a scope for Names. // Use of multiple namespaces is optional @@ -3203,6 +3233,8 @@ type Namespace struct { Status NamespaceStatus } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // NamespaceList is a list of Namespaces. type NamespaceList struct { metav1.TypeMeta @@ -3212,6 +3244,8 @@ type NamespaceList struct { Items []Namespace } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // Binding ties one object to another; for example, a pod is bound to a node by a scheduler. // Deprecated in 1.7, please use the bindings subresource of pods instead. type Binding struct { @@ -3245,6 +3279,8 @@ const ( DeletePropagationForeground DeletionPropagation = "Foreground" ) +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // DeleteOptions may be provided when deleting an API object // DEPRECATED: This type has been moved to meta/v1 and will be removed soon. type DeleteOptions struct { @@ -3276,6 +3312,8 @@ type DeleteOptions struct { PropagationPolicy *DeletionPropagation } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // ListOptions is the query options to a standard REST list call, and has future support for // watch calls. // DEPRECATED: This type has been moved to meta/v1 and will be removed soon. @@ -3303,6 +3341,8 @@ type ListOptions struct { TimeoutSeconds *int64 } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // PodLogOptions is the query options for a Pod's logs REST call type PodLogOptions struct { metav1.TypeMeta @@ -3335,6 +3375,8 @@ type PodLogOptions struct { LimitBytes *int64 } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // PodAttachOptions is the query options to a Pod's remote attach call // TODO: merge w/ PodExecOptions below for stdin, stdout, etc type PodAttachOptions struct { @@ -3361,6 +3403,8 @@ type PodAttachOptions struct { Container string } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // PodExecOptions is the query options to a Pod's remote exec call type PodExecOptions struct { metav1.TypeMeta @@ -3384,6 +3428,8 @@ type PodExecOptions struct { Command []string } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // PodPortForwardOptions is the query options to a Pod's port forward call type PodPortForwardOptions struct { metav1.TypeMeta @@ -3393,6 +3439,8 @@ type PodPortForwardOptions struct { Ports []int32 } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // PodProxyOptions is the query options to a Pod's proxy call type PodProxyOptions struct { metav1.TypeMeta @@ -3401,6 +3449,8 @@ type PodProxyOptions struct { Path string } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // NodeProxyOptions is the query options to a Node's proxy call type NodeProxyOptions struct { metav1.TypeMeta @@ -3409,6 +3459,8 @@ type NodeProxyOptions struct { Path string } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // ServiceProxyOptions is the query options to a Service's proxy call. type ServiceProxyOptions struct { metav1.TypeMeta @@ -3422,6 +3474,7 @@ type ServiceProxyOptions struct { } // ObjectReference contains enough information to let you inspect or modify the referred object. +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type ObjectReference struct { // +optional Kind string @@ -3454,6 +3507,8 @@ type LocalObjectReference struct { Name string } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + type SerializedReference struct { metav1.TypeMeta // +optional @@ -3478,6 +3533,7 @@ const ( ) // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // Event is a report of an event somewhere in the cluster. // TODO: Decide whether to store these separately or with the object they apply to. @@ -3523,6 +3579,8 @@ type Event struct { Type string } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // EventList is a list of events. type EventList struct { metav1.TypeMeta @@ -3532,6 +3590,8 @@ type EventList struct { Items []Event } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // List holds a list of objects, which may not be known by the server. type List struct { metav1.TypeMeta @@ -3582,6 +3642,7 @@ type LimitRangeSpec struct { } // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // LimitRange sets resource usage limits for each kind of resource in a Namespace type LimitRange struct { @@ -3594,6 +3655,8 @@ type LimitRange struct { Spec LimitRangeSpec } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // LimitRangeList is a list of LimitRange items. type LimitRangeList struct { metav1.TypeMeta @@ -3672,6 +3735,7 @@ type ResourceQuotaStatus struct { } // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // ResourceQuota sets aggregate quota restrictions enforced per namespace type ResourceQuota struct { @@ -3688,6 +3752,8 @@ type ResourceQuota struct { Status ResourceQuotaStatus } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // ResourceQuotaList is a list of ResourceQuota items type ResourceQuotaList struct { metav1.TypeMeta @@ -3699,6 +3765,7 @@ type ResourceQuotaList struct { } // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // Secret holds secret data of a certain type. The total bytes of the values in // the Data field must be less than MaxSecretSize bytes. @@ -3803,6 +3870,8 @@ const ( TLSPrivateKeyKey = "tls.key" ) +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + type SecretList struct { metav1.TypeMeta // +optional @@ -3812,6 +3881,7 @@ type SecretList struct { } // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // ConfigMap holds configuration data for components or applications to consume. type ConfigMap struct { @@ -3825,6 +3895,8 @@ type ConfigMap struct { Data map[string]string } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // ConfigMapList is a resource containing a list of ConfigMap objects. type ConfigMapList struct { metav1.TypeMeta @@ -3895,6 +3967,7 @@ type ComponentCondition struct { // +genclient=true // +nonNamespaced=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // ComponentStatus (and ComponentStatusList) holds the cluster validation info. type ComponentStatus struct { @@ -3906,6 +3979,8 @@ type ComponentStatus struct { Conditions []ComponentCondition } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + type ComponentStatusList struct { metav1.TypeMeta // +optional @@ -3969,6 +4044,8 @@ type SELinuxOptions struct { Level string } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // RangeAllocation is an opaque API object (not exposed to end users) that can be persisted to record // the global allocation state of the cluster. The schema of Range and Data generic, in that Range // should be a string representation of the inputs to a range (for instance, for IP allocation it diff --git a/pkg/api/unversioned/time.go b/pkg/api/unversioned/time.go index c4244ed194b..8799817a8fd 100644 --- a/pkg/api/unversioned/time.go +++ b/pkg/api/unversioned/time.go @@ -33,11 +33,11 @@ type Time struct { time.Time `protobuf:"-"` } -// DeepCopy returns a deep-copy of the Time value. The underlying time.Time +// DeepCopyInto creates a deep-copy of the Time value. The underlying time.Time // type is effectively immutable in the time API, so it is safe to // copy-by-assign, despite the presence of (unexported) Pointer fields. -func (t Time) DeepCopy() Time { - return t +func (t *Time) DeepCopyInto(out *Time) { + *out = *t } // String returns the representation of the time. diff --git a/pkg/api/unversioned/types.go b/pkg/api/unversioned/types.go index 61137725a62..dee36ed3f6e 100644 --- a/pkg/api/unversioned/types.go +++ b/pkg/api/unversioned/types.go @@ -23,6 +23,8 @@ package unversioned // TypeMeta describes an individual object in an API response or request // with strings representing the type of the object and its API schema version. // Structures that are versioned or persisted should inline TypeMeta. +// +// +k8s:deepcopy-gen=false type TypeMeta struct { // Kind is a string value representing the REST resource this object represents. // Servers may infer this from the endpoint the client submits requests to. diff --git a/pkg/apis/abac/doc.go b/pkg/apis/abac/doc.go new file mode 100644 index 00000000000..9d24e1135f0 --- /dev/null +++ b/pkg/apis/abac/doc.go @@ -0,0 +1,19 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// +k8s:deepcopy-gen=package + +package abac diff --git a/pkg/apis/abac/types.go b/pkg/apis/abac/types.go index 48b7723a7da..3f094b724b3 100644 --- a/pkg/apis/abac/types.go +++ b/pkg/apis/abac/types.go @@ -20,6 +20,8 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // Policy contains a single ABAC policy rule type Policy struct { metav1.TypeMeta diff --git a/pkg/apis/abac/v0/doc.go b/pkg/apis/abac/v0/doc.go new file mode 100644 index 00000000000..d35c8b86ac2 --- /dev/null +++ b/pkg/apis/abac/v0/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// +k8s:deepcopy-gen=package,register + +// +groupName=abac.authorization.kubernetes.io +package v0 // import "k8s.io/kubernetes/pkg/apis/abac/v0" diff --git a/pkg/apis/abac/v0/types.go b/pkg/apis/abac/v0/types.go index 3590cd4ce1c..b6b0af1ad59 100644 --- a/pkg/apis/abac/v0/types.go +++ b/pkg/apis/abac/v0/types.go @@ -21,6 +21,8 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // Policy contains a single ABAC policy rule type Policy struct { metav1.TypeMeta `json:",inline"` diff --git a/pkg/apis/abac/v1beta1/types.go b/pkg/apis/abac/v1beta1/types.go index ee7326fc78d..21a3133f21f 100644 --- a/pkg/apis/abac/v1beta1/types.go +++ b/pkg/apis/abac/v1beta1/types.go @@ -21,6 +21,8 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // Policy contains a single ABAC policy rule type Policy struct { metav1.TypeMeta `json:",inline"` diff --git a/pkg/apis/admission/types.go b/pkg/apis/admission/types.go index 2cc36c283f7..86efca6d7f5 100644 --- a/pkg/apis/admission/types.go +++ b/pkg/apis/admission/types.go @@ -23,6 +23,8 @@ import ( "k8s.io/kubernetes/pkg/apis/authentication" ) +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // AdmissionReview describes an admission request. type AdmissionReview struct { metav1.TypeMeta diff --git a/pkg/apis/admission/v1alpha1/types.go b/pkg/apis/admission/v1alpha1/types.go index 9a8d08545ec..c727f05292b 100644 --- a/pkg/apis/admission/v1alpha1/types.go +++ b/pkg/apis/admission/v1alpha1/types.go @@ -23,6 +23,8 @@ import ( "k8s.io/apiserver/pkg/admission" ) +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // AdmissionReview describes an admission request. type AdmissionReview struct { metav1.TypeMeta `json:",inline"` diff --git a/pkg/apis/admissionregistration/types.go b/pkg/apis/admissionregistration/types.go index 27b72072912..2f74ebfa48a 100644 --- a/pkg/apis/admissionregistration/types.go +++ b/pkg/apis/admissionregistration/types.go @@ -22,6 +22,7 @@ import ( // +genclient=true // +nonNamespaced=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // InitializerConfiguration describes the configuration of initializers. type InitializerConfiguration struct { @@ -40,6 +41,8 @@ type InitializerConfiguration struct { Initializers []Initializer } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // InitializerConfigurationList is a list of InitializerConfiguration. type InitializerConfigurationList struct { metav1.TypeMeta @@ -120,6 +123,7 @@ const ( // +genclient=true // +nonNamespaced=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // ExternalAdmissionHookConfiguration describes the configuration of initializers. type ExternalAdmissionHookConfiguration struct { @@ -133,6 +137,8 @@ type ExternalAdmissionHookConfiguration struct { ExternalAdmissionHooks []ExternalAdmissionHook } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // ExternalAdmissionHookConfigurationList is a list of ExternalAdmissionHookConfiguration. type ExternalAdmissionHookConfigurationList struct { metav1.TypeMeta diff --git a/pkg/apis/apps/types.go b/pkg/apis/apps/types.go index 403a88a608e..1468f7fe03e 100644 --- a/pkg/apis/apps/types.go +++ b/pkg/apis/apps/types.go @@ -23,6 +23,7 @@ import ( ) // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // StatefulSet represents a set of pods with consistent identities. // Identities are defined as: @@ -188,6 +189,8 @@ type StatefulSetStatus struct { UpdateRevision string } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // StatefulSetList is a collection of StatefulSets. type StatefulSetList struct { metav1.TypeMeta @@ -197,6 +200,7 @@ type StatefulSetList struct { } // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // ControllerRevision implements an immutable snapshot of state data. Clients // are responsible for serializing and deserializing the objects that contain @@ -218,6 +222,8 @@ type ControllerRevision struct { Revision int64 } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // ControllerRevisionList is a resource containing a list of ControllerRevision objects. type ControllerRevisionList struct { metav1.TypeMeta diff --git a/pkg/apis/authentication/types.go b/pkg/apis/authentication/types.go index 9c1e66b7bbd..2ed75dc1497 100644 --- a/pkg/apis/authentication/types.go +++ b/pkg/apis/authentication/types.go @@ -38,6 +38,7 @@ const ( // +genclient=true // +nonNamespaced=true // +noMethods=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // TokenReview attempts to authenticate a token to a known user. type TokenReview struct { diff --git a/pkg/apis/authorization/types.go b/pkg/apis/authorization/types.go index d8ccfaf3585..f9776cdcc64 100644 --- a/pkg/apis/authorization/types.go +++ b/pkg/apis/authorization/types.go @@ -23,6 +23,7 @@ import ( // +genclient=true // +nonNamespaced=true // +noMethods=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // SubjectAccessReview checks whether or not a user or group can perform an action. Not filling in a // spec.namespace means "in all namespaces". @@ -40,6 +41,7 @@ type SubjectAccessReview struct { // +genclient=true // +nonNamespaced=true // +noMethods=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // SelfSubjectAccessReview checks whether or the current user can perform an action. Not filling in a // spec.namespace means "in all namespaces". Self is a special case, because users should always be able @@ -57,6 +59,7 @@ type SelfSubjectAccessReview struct { // +genclient=true // +noMethods=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // LocalSubjectAccessReview checks whether or not a user or group can perform an action in a given namespace. // Having a namespace scoped resource makes it much easier to grant namespace scoped policy that includes permissions diff --git a/pkg/apis/autoscaling/types.go b/pkg/apis/autoscaling/types.go index 04d88e21193..01c6f37379e 100644 --- a/pkg/apis/autoscaling/types.go +++ b/pkg/apis/autoscaling/types.go @@ -22,6 +22,8 @@ import ( "k8s.io/kubernetes/pkg/api" ) +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // Scale represents a scaling request for a resource. type Scale struct { metav1.TypeMeta @@ -325,6 +327,7 @@ type ResourceMetricStatus struct { } // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // HorizontalPodAutoscaler is the configuration for a horizontal pod // autoscaler, which automatically manages the replica count of any resource @@ -346,6 +349,8 @@ type HorizontalPodAutoscaler struct { Status HorizontalPodAutoscalerStatus } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // HorizontalPodAutoscaler is a list of horizontal pod autoscaler objects. type HorizontalPodAutoscalerList struct { metav1.TypeMeta diff --git a/pkg/apis/batch/types.go b/pkg/apis/batch/types.go index 4437023aae7..46d01c23e6b 100644 --- a/pkg/apis/batch/types.go +++ b/pkg/apis/batch/types.go @@ -22,6 +22,7 @@ import ( ) // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // Job represents the configuration of a single job. type Job struct { @@ -42,6 +43,8 @@ type Job struct { Status JobStatus } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // JobList is a collection of jobs. type JobList struct { metav1.TypeMeta @@ -54,6 +57,8 @@ type JobList struct { Items []Job } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // JobTemplate describes a template for creating copies of a predefined pod. type JobTemplate struct { metav1.TypeMeta @@ -188,6 +193,7 @@ type JobCondition struct { } // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // CronJob represents the configuration of a single cron job. type CronJob struct { @@ -208,6 +214,8 @@ type CronJob struct { Status CronJobStatus } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // CronJobList is a collection of cron jobs. type CronJobList struct { metav1.TypeMeta diff --git a/pkg/apis/certificates/types.go b/pkg/apis/certificates/types.go index 4a7884a1ea4..413f7e79756 100644 --- a/pkg/apis/certificates/types.go +++ b/pkg/apis/certificates/types.go @@ -20,6 +20,7 @@ import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" // +genclient=true // +nonNamespaced=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // Describes a certificate signing request type CertificateSigningRequest struct { @@ -102,6 +103,8 @@ type CertificateSigningRequestCondition struct { LastUpdateTime metav1.Time } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + type CertificateSigningRequestList struct { metav1.TypeMeta // +optional diff --git a/pkg/apis/componentconfig/types.go b/pkg/apis/componentconfig/types.go index 4c99e4a42c0..fdbc3d93990 100644 --- a/pkg/apis/componentconfig/types.go +++ b/pkg/apis/componentconfig/types.go @@ -78,6 +78,8 @@ type KubeProxyConntrackConfiguration struct { TCPCloseWaitTimeout metav1.Duration } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // KubeProxyConfiguration contains everything necessary to configure the // Kubernetes proxy server. type KubeProxyConfiguration struct { @@ -166,6 +168,8 @@ const ( HairpinNone = "none" ) +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // A configuration field should go in KubeletFlags instead of KubeletConfiguration if any of these are true: // - its value will never, or cannot safely be changed during the lifetime of a node // - its value cannot be safely shared between nodes at the same time (e.g. a hostname) @@ -563,6 +567,8 @@ type KubeletAnonymousAuthentication struct { Enabled bool } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + type KubeSchedulerConfiguration struct { metav1.TypeMeta @@ -650,6 +656,8 @@ type GroupResource struct { Resource string } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + type KubeControllerManagerConfiguration struct { metav1.TypeMeta diff --git a/pkg/apis/componentconfig/v1alpha1/types.go b/pkg/apis/componentconfig/v1alpha1/types.go index 399a00a95a9..a0c3b471173 100644 --- a/pkg/apis/componentconfig/v1alpha1/types.go +++ b/pkg/apis/componentconfig/v1alpha1/types.go @@ -74,6 +74,8 @@ type KubeProxyConntrackConfiguration struct { TCPCloseWaitTimeout metav1.Duration `json:"tcpCloseWaitTimeout"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // KubeProxyConfiguration contains everything necessary to configure the // Kubernetes proxy server. type KubeProxyConfiguration struct { @@ -144,6 +146,8 @@ const ( ProxyModeIPTables ProxyMode = "iptables" ) +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + type KubeSchedulerConfiguration struct { metav1.TypeMeta `json:",inline"` @@ -241,6 +245,8 @@ type LeaderElectionConfiguration struct { ResourceLock string `json:"resourceLock"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // A configuration field should go in KubeletFlags instead of KubeletConfiguration if any of these are true: // - its value will never, or cannot safely be changed during the lifetime of a node // - its value cannot be safely shared between nodes at the same time (e.g. a hostname) diff --git a/pkg/apis/extensions/types.go b/pkg/apis/extensions/types.go index dffe1a89f77..b4ba2247889 100644 --- a/pkg/apis/extensions/types.go +++ b/pkg/apis/extensions/types.go @@ -62,6 +62,7 @@ type ScaleStatus struct { // +genclient=true // +noMethods=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // represents a scaling request for a resource. type Scale struct { @@ -79,6 +80,8 @@ type Scale struct { Status ScaleStatus } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // Dummy definition type ReplicationControllerDummy struct { metav1.TypeMeta @@ -109,6 +112,7 @@ type CustomMetricCurrentStatusList struct { // +genclient=true // +nonNamespaced=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // A ThirdPartyResource is a generic representation of a resource, it is used by add-ons and plugins to add new resource // types to the API. It consists of one or more Versions of the api. @@ -127,6 +131,8 @@ type ThirdPartyResource struct { Versions []APIVersion } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + type ThirdPartyResourceList struct { metav1.TypeMeta @@ -145,6 +151,8 @@ type APIVersion struct { Name string } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // An internal object, used for versioned storage in etcd. Not exposed to the end user. type ThirdPartyResourceData struct { metav1.TypeMeta @@ -158,6 +166,7 @@ type ThirdPartyResourceData struct { } // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type Deployment struct { metav1.TypeMeta @@ -221,6 +230,8 @@ type DeploymentSpec struct { ProgressDeadlineSeconds *int32 } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // DeploymentRollback stores the information required to rollback a deployment. type DeploymentRollback struct { metav1.TypeMeta @@ -367,6 +378,8 @@ type DeploymentCondition struct { Message string } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + type DeploymentList struct { metav1.TypeMeta // +optional @@ -507,6 +520,7 @@ type DaemonSetStatus struct { } // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // DaemonSet represents the configuration of a daemon set. type DaemonSet struct { @@ -538,6 +552,8 @@ const ( DaemonSetTemplateGenerationKey string = "pod-template-generation" ) +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // DaemonSetList is a collection of daemon sets. type DaemonSetList struct { metav1.TypeMeta @@ -550,6 +566,8 @@ type DaemonSetList struct { Items []DaemonSet } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + type ThirdPartyResourceDataList struct { metav1.TypeMeta // Standard list metadata @@ -561,6 +579,7 @@ type ThirdPartyResourceDataList struct { } // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // Ingress is a collection of rules that allow inbound connections to reach the // endpoints defined by a backend. An Ingress can be configured to give services @@ -584,6 +603,8 @@ type Ingress struct { Status IngressStatus } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // IngressList is a collection of Ingress. type IngressList struct { metav1.TypeMeta @@ -727,6 +748,7 @@ type IngressBackend struct { } // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // ReplicaSet represents the configuration of a replica set. type ReplicaSet struct { @@ -744,6 +766,8 @@ type ReplicaSet struct { Status ReplicaSetStatus } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // ReplicaSetList is a collection of ReplicaSets. type ReplicaSetList struct { metav1.TypeMeta @@ -834,6 +858,7 @@ type ReplicaSetCondition struct { // +genclient=true // +nonNamespaced=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // PodSecurityPolicy governs the ability to make requests that affect the SecurityContext // that will be applied to a pod and container. @@ -1045,6 +1070,8 @@ const ( SupplementalGroupsStrategyRunAsAny SupplementalGroupsStrategyType = "RunAsAny" ) +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // PodSecurityPolicyList is a list of PodSecurityPolicy objects. type PodSecurityPolicyList struct { metav1.TypeMeta @@ -1055,6 +1082,7 @@ type PodSecurityPolicyList struct { } // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // NetworkPolicy describes what network traffic is allowed for a set of Pods type NetworkPolicy struct { @@ -1137,6 +1165,8 @@ type NetworkPolicyPeer struct { NamespaceSelector *metav1.LabelSelector } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // NetworkPolicyList is a list of NetworkPolicy objects. type NetworkPolicyList struct { metav1.TypeMeta diff --git a/pkg/apis/imagepolicy/types.go b/pkg/apis/imagepolicy/types.go index d23d2c8a9bf..c9e4335b5fe 100644 --- a/pkg/apis/imagepolicy/types.go +++ b/pkg/apis/imagepolicy/types.go @@ -23,6 +23,7 @@ import ( // +genclient=true // +nonNamespaced=true // +noMethods=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // ImageReview checks if the set of images in a pod are allowed. type ImageReview struct { diff --git a/pkg/apis/meta/v1/time.go b/pkg/apis/meta/v1/time.go index a1e01f34431..49d2ac18ec2 100644 --- a/pkg/apis/meta/v1/time.go +++ b/pkg/apis/meta/v1/time.go @@ -37,11 +37,11 @@ type Time struct { time.Time `protobuf:"-"` } -// DeepCopy returns a deep-copy of the Time value. The underlying time.Time +// DeepCopyInto creates a deep-copy of the Time value. The underlying time.Time // type is effectively immutable in the time API, so it is safe to // copy-by-assign, despite the presence of (unexported) Pointer fields. -func (t Time) DeepCopy() Time { - return t +func (t *Time) DeepCopyInto(out *Time) { + *out = *t } // String returns the representation of the time. diff --git a/pkg/apis/networking/types.go b/pkg/apis/networking/types.go index f889543ed75..8aab38fd61a 100644 --- a/pkg/apis/networking/types.go +++ b/pkg/apis/networking/types.go @@ -23,6 +23,7 @@ import ( ) // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // NetworkPolicy describes what network traffic is allowed for a set of Pods type NetworkPolicy struct { @@ -105,6 +106,8 @@ type NetworkPolicyPeer struct { NamespaceSelector *metav1.LabelSelector } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // NetworkPolicyList is a list of NetworkPolicy objects. type NetworkPolicyList struct { metav1.TypeMeta diff --git a/pkg/apis/policy/types.go b/pkg/apis/policy/types.go index 4d49da17471..71a771f7ff8 100644 --- a/pkg/apis/policy/types.go +++ b/pkg/apis/policy/types.go @@ -78,6 +78,7 @@ type PodDisruptionBudgetStatus struct { } // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods type PodDisruptionBudget struct { @@ -93,6 +94,8 @@ type PodDisruptionBudget struct { Status PodDisruptionBudgetStatus } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // PodDisruptionBudgetList is a collection of PodDisruptionBudgets. type PodDisruptionBudgetList struct { metav1.TypeMeta @@ -103,6 +106,7 @@ type PodDisruptionBudgetList struct { // +genclient=true // +noMethods=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // Eviction evicts a pod from its node subject to certain policies and safety constraints. // This is a subresource of Pod. A request to cause such an eviction is diff --git a/pkg/apis/policy/v1alpha1/doc.go b/pkg/apis/policy/v1alpha1/doc.go index 652f9f9eaf4..e5b6777ce26 100644 --- a/pkg/apis/policy/v1alpha1/doc.go +++ b/pkg/apis/policy/v1alpha1/doc.go @@ -15,6 +15,7 @@ limitations under the License. */ // +k8s:defaulter-gen=TypeMeta +// +k8s:deepcopy-gen=package,register // Package policy is for any kind of policy object. Suitable examples, even if // they aren't all here, are PodDisruptionBudget, PodSecurityPolicy, diff --git a/pkg/apis/policy/v1alpha1/types.go b/pkg/apis/policy/v1alpha1/types.go index 951df533ba9..aeb4bf7e60c 100644 --- a/pkg/apis/policy/v1alpha1/types.go +++ b/pkg/apis/policy/v1alpha1/types.go @@ -53,6 +53,7 @@ type PodDisruptionBudgetStatus struct { } // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods type PodDisruptionBudget struct { @@ -68,6 +69,8 @@ type PodDisruptionBudget struct { Status PodDisruptionBudgetStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // PodDisruptionBudgetList is a collection of PodDisruptionBudgets. type PodDisruptionBudgetList struct { metav1.TypeMeta `json:",inline"` @@ -76,6 +79,8 @@ type PodDisruptionBudgetList struct { Items []PodDisruptionBudget `json:"items" protobuf:"bytes,2,rep,name=items"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // Eviction evicts a pod from its node subject to certain policies and safety constraints. // This is a subresource of Pod. A request to cause such an eviction is // created by POSTing to .../pods//eviction. diff --git a/pkg/apis/rbac/types.go b/pkg/apis/rbac/types.go index ddc2456a022..e35677ef0c1 100644 --- a/pkg/apis/rbac/types.go +++ b/pkg/apis/rbac/types.go @@ -88,6 +88,7 @@ type RoleRef struct { } // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding. type Role struct { @@ -100,6 +101,7 @@ type Role struct { } // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // RoleBinding references a role, but does not contain it. It can reference a Role in the same namespace or a ClusterRole in the global namespace. // It adds who information via Subjects and namespace information by which namespace it exists in. RoleBindings in a given @@ -116,6 +118,8 @@ type RoleBinding struct { RoleRef RoleRef } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // RoleBindingList is a collection of RoleBindings type RoleBindingList struct { metav1.TypeMeta @@ -126,6 +130,8 @@ type RoleBindingList struct { Items []RoleBinding } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // RoleList is a collection of Roles type RoleList struct { metav1.TypeMeta @@ -138,6 +144,7 @@ type RoleList struct { // +genclient=true // +nonNamespaced=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding. type ClusterRole struct { @@ -151,6 +158,7 @@ type ClusterRole struct { // +genclient=true // +nonNamespaced=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // ClusterRoleBinding references a ClusterRole, but not contain it. It can reference a ClusterRole in the global namespace, // and adds who information via Subject. @@ -167,6 +175,8 @@ type ClusterRoleBinding struct { RoleRef RoleRef } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // ClusterRoleBindingList is a collection of ClusterRoleBindings type ClusterRoleBindingList struct { metav1.TypeMeta @@ -177,6 +187,8 @@ type ClusterRoleBindingList struct { Items []ClusterRoleBinding } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // ClusterRoleList is a collection of ClusterRoles type ClusterRoleList struct { metav1.TypeMeta diff --git a/pkg/apis/settings/types.go b/pkg/apis/settings/types.go index b6d692e78f9..fca09ee5f8b 100644 --- a/pkg/apis/settings/types.go +++ b/pkg/apis/settings/types.go @@ -22,6 +22,7 @@ import ( ) // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // PodPreset is a policy resource that defines additional runtime // requirements for a Pod. @@ -53,6 +54,8 @@ type PodPresetSpec struct { VolumeMounts []api.VolumeMount } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // PodPresetList is a list of PodPreset objects. type PodPresetList struct { metav1.TypeMeta diff --git a/pkg/apis/storage/types.go b/pkg/apis/storage/types.go index 827e7c66652..7b676de7378 100644 --- a/pkg/apis/storage/types.go +++ b/pkg/apis/storage/types.go @@ -20,6 +20,7 @@ import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" // +genclient=true // +nonNamespaced=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // StorageClass describes a named "class" of storage offered in a cluster. // Different classes might map to quality-of-service levels, or to backup policies, @@ -47,6 +48,8 @@ type StorageClass struct { Parameters map[string]string } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // StorageClassList is a collection of storage classes. type StorageClassList struct { metav1.TypeMeta diff --git a/pkg/controller/garbagecollector/metaonly/types.go b/pkg/controller/garbagecollector/metaonly/types.go index a738ffa9d96..fce648f3073 100644 --- a/pkg/controller/garbagecollector/metaonly/types.go +++ b/pkg/controller/garbagecollector/metaonly/types.go @@ -23,6 +23,9 @@ import ( // MetadataOnlyObject allows decoding only the apiVersion, kind, and metadata fields of // JSON data. // TODO: enable meta-only decoding for protobuf. +// +// +k8s:deepcopy-gen=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type MetadataOnlyObject struct { metav1.TypeMeta `json:",inline"` // +optional @@ -32,6 +35,9 @@ type MetadataOnlyObject struct { // MetadataOnlyObjectList allows decoding from JSON data only the typemeta and metadata of // a list, and those of the enclosing objects. // TODO: enable meta-only decoding for protobuf. +// +// +k8s:deepcopy-gen=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type MetadataOnlyObjectList struct { metav1.TypeMeta `json:",inline"` // +optional diff --git a/pkg/kubectl/cmd/testing/fake.go b/pkg/kubectl/cmd/testing/fake.go index 48b5d52550e..b23959b385b 100644 --- a/pkg/kubectl/cmd/testing/fake.go +++ b/pkg/kubectl/cmd/testing/fake.go @@ -49,6 +49,8 @@ import ( "k8s.io/kubernetes/pkg/printers" ) +// +k8s:deepcopy-gen=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type InternalType struct { Kind string APIVersion string @@ -56,6 +58,8 @@ type InternalType struct { Name string } +// +k8s:deepcopy-gen=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type ExternalType struct { Kind string `json:"kind"` APIVersion string `json:"apiVersion"` @@ -63,6 +67,8 @@ type ExternalType struct { Name string `json:"name"` } +// +k8s:deepcopy-gen=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type ExternalType2 struct { Kind string `json:"kind"` APIVersion string `json:"apiVersion"` @@ -99,6 +105,8 @@ func NewInternalType(kind, apiversion, name string) *InternalType { return &item } +// +k8s:deepcopy-gen=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type InternalNamespacedType struct { Kind string APIVersion string @@ -107,6 +115,8 @@ type InternalNamespacedType struct { Namespace string } +// +k8s:deepcopy-gen=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type ExternalNamespacedType struct { Kind string `json:"kind"` APIVersion string `json:"apiVersion"` @@ -115,6 +125,8 @@ type ExternalNamespacedType struct { Namespace string `json:"namespace"` } +// +k8s:deepcopy-gen=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type ExternalNamespacedType2 struct { Kind string `json:"kind"` APIVersion string `json:"apiVersion"` diff --git a/pkg/kubectl/testing/types.go b/pkg/kubectl/testing/types.go index 2b8ca1df5d1..23e417e130a 100644 --- a/pkg/kubectl/testing/types.go +++ b/pkg/kubectl/testing/types.go @@ -20,6 +20,8 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + type TestStruct struct { metav1.TypeMeta `json:",inline"` // +optional diff --git a/pkg/kubelet/network/plugins.go b/pkg/kubelet/network/plugins.go index 74a929ce74a..ca75c95a336 100644 --- a/pkg/kubelet/network/plugins.go +++ b/pkg/kubelet/network/plugins.go @@ -78,6 +78,8 @@ type NetworkPlugin interface { Status() error } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // PodNetworkStatus stores the network status of a pod (currently just the primary IP address) // This struct represents version "v1beta1" type PodNetworkStatus struct { diff --git a/pkg/printers/internalversion/printers_test.go b/pkg/printers/internalversion/printers_test.go index a2083a8e264..ad47ec7c67e 100644 --- a/pkg/printers/internalversion/printers_test.go +++ b/pkg/printers/internalversion/printers_test.go @@ -215,10 +215,24 @@ type TestPrintType struct { } func (obj *TestPrintType) GetObjectKind() schema.ObjectKind { return schema.EmptyObjectKind } +func (obj *TestPrintType) DeepCopyObject() runtime.Object { + if obj == nil { + return nil + } + clone := *obj + return &clone +} type TestUnknownType struct{} func (obj *TestUnknownType) GetObjectKind() schema.ObjectKind { return schema.EmptyObjectKind } +func (obj *TestUnknownType) DeepCopyObject() runtime.Object { + if obj == nil { + return nil + } + clone := *obj + return &clone +} func TestPrinter(t *testing.T) { //test inputs diff --git a/plugin/pkg/admission/podtolerationrestriction/apis/podtolerationrestriction/types.go b/plugin/pkg/admission/podtolerationrestriction/apis/podtolerationrestriction/types.go index b066171a5ed..28ae2eae677 100644 --- a/plugin/pkg/admission/podtolerationrestriction/apis/podtolerationrestriction/types.go +++ b/plugin/pkg/admission/podtolerationrestriction/apis/podtolerationrestriction/types.go @@ -21,6 +21,8 @@ import ( "k8s.io/kubernetes/pkg/api" ) +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // Configuration provides configuration for the PodTolerationRestriction admission controller. type Configuration struct { metav1.TypeMeta diff --git a/plugin/pkg/admission/podtolerationrestriction/apis/podtolerationrestriction/v1alpha1/types.go b/plugin/pkg/admission/podtolerationrestriction/apis/podtolerationrestriction/v1alpha1/types.go index 562e912216e..38277b59f45 100644 --- a/plugin/pkg/admission/podtolerationrestriction/apis/podtolerationrestriction/v1alpha1/types.go +++ b/plugin/pkg/admission/podtolerationrestriction/apis/podtolerationrestriction/v1alpha1/types.go @@ -21,6 +21,8 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // Configuration provides configuration for the PodTolerationRestriction admission controller. type Configuration struct { metav1.TypeMeta `json:",inline"` diff --git a/plugin/pkg/admission/resourcequota/apis/resourcequota/types.go b/plugin/pkg/admission/resourcequota/apis/resourcequota/types.go index 15b8904be9b..88602d01582 100644 --- a/plugin/pkg/admission/resourcequota/apis/resourcequota/types.go +++ b/plugin/pkg/admission/resourcequota/apis/resourcequota/types.go @@ -18,6 +18,8 @@ package resourcequota import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // Configuration provides configuration for the ResourceQuota admission controller. type Configuration struct { metav1.TypeMeta diff --git a/plugin/pkg/admission/resourcequota/apis/resourcequota/v1alpha1/types.go b/plugin/pkg/admission/resourcequota/apis/resourcequota/v1alpha1/types.go index 1a5e1dc69e2..4774582314d 100644 --- a/plugin/pkg/admission/resourcequota/apis/resourcequota/v1alpha1/types.go +++ b/plugin/pkg/admission/resourcequota/apis/resourcequota/v1alpha1/types.go @@ -18,6 +18,8 @@ package v1alpha1 import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // Configuration provides configuration for the ResourceQuota admission controller. type Configuration struct { metav1.TypeMeta `json:",inline"` diff --git a/plugin/pkg/scheduler/api/doc.go b/plugin/pkg/scheduler/api/doc.go new file mode 100644 index 00000000000..184de2edf31 --- /dev/null +++ b/plugin/pkg/scheduler/api/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// +k8s:deepcopy-gen=package,register + +// Package api contains scheduler plugin API objects. +package api // import "k8s.io/kubernetes/plugin/pkg/scheduler/api" diff --git a/plugin/pkg/scheduler/api/types.go b/plugin/pkg/scheduler/api/types.go index cbb880e96bc..0a8baf878e9 100644 --- a/plugin/pkg/scheduler/api/types.go +++ b/plugin/pkg/scheduler/api/types.go @@ -33,6 +33,8 @@ const ( MaxWeight = MaxInt / MaxPriority ) +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + type Policy struct { metav1.TypeMeta // Holds the information to configure the fit predicate functions diff --git a/plugin/pkg/scheduler/api/v1/doc.go b/plugin/pkg/scheduler/api/v1/doc.go new file mode 100644 index 00000000000..49d3063b42f --- /dev/null +++ b/plugin/pkg/scheduler/api/v1/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// +k8s:deepcopy-gen=package,register + +// Package v1 contains scheduler plugin API objects. +package v1 // import "k8s.io/kubernetes/plugin/pkg/scheduler/api/v1" diff --git a/plugin/pkg/scheduler/api/v1/types.go b/plugin/pkg/scheduler/api/v1/types.go index 6dbf096b8b9..4f1b2369d22 100644 --- a/plugin/pkg/scheduler/api/v1/types.go +++ b/plugin/pkg/scheduler/api/v1/types.go @@ -25,6 +25,8 @@ import ( restclient "k8s.io/client-go/rest" ) +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + type Policy struct { metav1.TypeMeta `json:",inline"` // Holds the information to configure the fit predicate functions diff --git a/staging/src/k8s.io/api/admissionregistration/v1alpha1/types.go b/staging/src/k8s.io/api/admissionregistration/v1alpha1/types.go index 0d878095c8e..aa6b0c674f0 100644 --- a/staging/src/k8s.io/api/admissionregistration/v1alpha1/types.go +++ b/staging/src/k8s.io/api/admissionregistration/v1alpha1/types.go @@ -22,6 +22,7 @@ import ( // +genclient=true // +nonNamespaced=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // InitializerConfiguration describes the configuration of initializers. type InitializerConfiguration struct { @@ -42,6 +43,8 @@ type InitializerConfiguration struct { Initializers []Initializer `json:"initializers,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,2,rep,name=initializers"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // InitializerConfigurationList is a list of InitializerConfiguration. type InitializerConfigurationList struct { metav1.TypeMeta `json:",inline"` @@ -122,6 +125,7 @@ const ( // +genclient=true // +nonNamespaced=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // ExternalAdmissionHookConfiguration describes the configuration of initializers. type ExternalAdmissionHookConfiguration struct { @@ -137,6 +141,8 @@ type ExternalAdmissionHookConfiguration struct { ExternalAdmissionHooks []ExternalAdmissionHook `json:"externalAdmissionHooks,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,2,rep,name=externalAdmissionHooks"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // ExternalAdmissionHookConfigurationList is a list of ExternalAdmissionHookConfiguration. type ExternalAdmissionHookConfigurationList struct { metav1.TypeMeta `json:",inline"` diff --git a/staging/src/k8s.io/api/apps/v1beta1/types.go b/staging/src/k8s.io/api/apps/v1beta1/types.go index 3836cf2f4ff..19d45c5af1a 100644 --- a/staging/src/k8s.io/api/apps/v1beta1/types.go +++ b/staging/src/k8s.io/api/apps/v1beta1/types.go @@ -58,6 +58,7 @@ type ScaleStatus struct { // +genclient=true // +noMethods=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // Scale represents a scaling request for a resource. type Scale struct { @@ -76,6 +77,7 @@ type Scale struct { } // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // StatefulSet represents a set of pods with consistent identities. // Identities are defined as: @@ -241,6 +243,8 @@ type StatefulSetStatus struct { UpdateRevision string `json:"updateRevision,omitempty" protobuf:"bytes,7,opt,name=updateRevision"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // StatefulSetList is a collection of StatefulSets. type StatefulSetList struct { metav1.TypeMeta `json:",inline"` @@ -250,6 +254,7 @@ type StatefulSetList struct { } // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // Deployment enables declarative updates for Pods and ReplicaSets. type Deployment struct { @@ -316,6 +321,8 @@ type DeploymentSpec struct { ProgressDeadlineSeconds *int32 `json:"progressDeadlineSeconds,omitempty" protobuf:"varint,9,opt,name=progressDeadlineSeconds"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // DeploymentRollback stores the information required to rollback a deployment. type DeploymentRollback struct { metav1.TypeMeta `json:",inline"` @@ -467,6 +474,8 @@ type DeploymentCondition struct { Message string `json:"message,omitempty" protobuf:"bytes,5,opt,name=message"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // DeploymentList is a list of Deployments. type DeploymentList struct { metav1.TypeMeta `json:",inline"` @@ -479,6 +488,7 @@ type DeploymentList struct { } // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // ControllerRevision implements an immutable snapshot of state data. Clients // are responsible for serializing and deserializing the objects that contain @@ -503,6 +513,8 @@ type ControllerRevision struct { Revision int64 `json:"revision" protobuf:"varint,3,opt,name=revision"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // ControllerRevisionList is a resource containing a list of ControllerRevision objects. type ControllerRevisionList struct { metav1.TypeMeta `json:",inline"` diff --git a/staging/src/k8s.io/api/authentication/v1/types.go b/staging/src/k8s.io/api/authentication/v1/types.go index 21051f137bb..0beb4ac7e12 100644 --- a/staging/src/k8s.io/api/authentication/v1/types.go +++ b/staging/src/k8s.io/api/authentication/v1/types.go @@ -40,6 +40,7 @@ const ( // +genclient=true // +nonNamespaced=true // +noMethods=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // TokenReview attempts to authenticate a token to a known user. // Note: TokenReview requests may be cached by the webhook token authenticator diff --git a/staging/src/k8s.io/api/authentication/v1beta1/types.go b/staging/src/k8s.io/api/authentication/v1beta1/types.go index 57c96e3bc44..7d7ca2811c3 100644 --- a/staging/src/k8s.io/api/authentication/v1beta1/types.go +++ b/staging/src/k8s.io/api/authentication/v1beta1/types.go @@ -25,6 +25,7 @@ import ( // +genclient=true // +nonNamespaced=true // +noMethods=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // TokenReview attempts to authenticate a token to a known user. // Note: TokenReview requests may be cached by the webhook token authenticator diff --git a/staging/src/k8s.io/api/authorization/v1/types.go b/staging/src/k8s.io/api/authorization/v1/types.go index 38c314ffcfb..25bc19cfcb1 100644 --- a/staging/src/k8s.io/api/authorization/v1/types.go +++ b/staging/src/k8s.io/api/authorization/v1/types.go @@ -25,6 +25,7 @@ import ( // +genclient=true // +nonNamespaced=true // +noMethods=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // SubjectAccessReview checks whether or not a user or group can perform an action. type SubjectAccessReview struct { @@ -43,6 +44,7 @@ type SubjectAccessReview struct { // +genclient=true // +nonNamespaced=true // +noMethods=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // SelfSubjectAccessReview checks whether or the current user can perform an action. Not filling in a // spec.namespace means "in all namespaces". Self is a special case, because users should always be able @@ -62,6 +64,7 @@ type SelfSubjectAccessReview struct { // +genclient=true // +noMethods=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // LocalSubjectAccessReview checks whether or not a user or group can perform an action in a given namespace. // Having a namespace scoped resource makes it much easier to grant namespace scoped policy that includes permissions diff --git a/staging/src/k8s.io/api/authorization/v1beta1/types.go b/staging/src/k8s.io/api/authorization/v1beta1/types.go index 8a1727423b8..43ce4b01eb3 100644 --- a/staging/src/k8s.io/api/authorization/v1beta1/types.go +++ b/staging/src/k8s.io/api/authorization/v1beta1/types.go @@ -25,6 +25,7 @@ import ( // +genclient=true // +nonNamespaced=true // +noMethods=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // SubjectAccessReview checks whether or not a user or group can perform an action. type SubjectAccessReview struct { @@ -43,6 +44,7 @@ type SubjectAccessReview struct { // +genclient=true // +nonNamespaced=true // +noMethods=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // SelfSubjectAccessReview checks whether or the current user can perform an action. Not filling in a // spec.namespace means "in all namespaces". Self is a special case, because users should always be able @@ -62,6 +64,7 @@ type SelfSubjectAccessReview struct { // +genclient=true // +noMethods=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // LocalSubjectAccessReview checks whether or not a user or group can perform an action in a given namespace. // Having a namespace scoped resource makes it much easier to grant namespace scoped policy that includes permissions diff --git a/staging/src/k8s.io/api/autoscaling/v1/types.go b/staging/src/k8s.io/api/autoscaling/v1/types.go index bf2d4893cbd..3b3390cfcfc 100644 --- a/staging/src/k8s.io/api/autoscaling/v1/types.go +++ b/staging/src/k8s.io/api/autoscaling/v1/types.go @@ -73,6 +73,7 @@ type HorizontalPodAutoscalerStatus struct { } // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // configuration of a horizontal pod autoscaler. type HorizontalPodAutoscaler struct { @@ -90,6 +91,8 @@ type HorizontalPodAutoscaler struct { Status HorizontalPodAutoscalerStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // list of horizontal pod autoscaler objects. type HorizontalPodAutoscalerList struct { metav1.TypeMeta `json:",inline"` @@ -101,6 +104,8 @@ type HorizontalPodAutoscalerList struct { Items []HorizontalPodAutoscaler `json:"items" protobuf:"bytes,2,rep,name=items"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // Scale represents a scaling request for a resource. type Scale struct { metav1.TypeMeta `json:",inline"` diff --git a/staging/src/k8s.io/api/autoscaling/v2alpha1/types.go b/staging/src/k8s.io/api/autoscaling/v2alpha1/types.go index 3c2497287db..dbea917aa02 100644 --- a/staging/src/k8s.io/api/autoscaling/v2alpha1/types.go +++ b/staging/src/k8s.io/api/autoscaling/v2alpha1/types.go @@ -276,6 +276,7 @@ type ResourceMetricStatus struct { } // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // HorizontalPodAutoscaler is the configuration for a horizontal pod // autoscaler, which automatically manages the replica count of any resource @@ -297,6 +298,8 @@ type HorizontalPodAutoscaler struct { Status HorizontalPodAutoscalerStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // HorizontalPodAutoscaler is a list of horizontal pod autoscaler objects. type HorizontalPodAutoscalerList struct { metav1.TypeMeta `json:",inline"` diff --git a/staging/src/k8s.io/api/batch/v1/types.go b/staging/src/k8s.io/api/batch/v1/types.go index 83b46f54677..f1e7ae09548 100644 --- a/staging/src/k8s.io/api/batch/v1/types.go +++ b/staging/src/k8s.io/api/batch/v1/types.go @@ -22,6 +22,7 @@ import ( ) // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // Job represents the configuration of a single job. type Job struct { @@ -42,6 +43,8 @@ type Job struct { Status JobStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // JobList is a collection of jobs. type JobList struct { metav1.TypeMeta `json:",inline"` diff --git a/staging/src/k8s.io/api/batch/v2alpha1/types.go b/staging/src/k8s.io/api/batch/v2alpha1/types.go index d8f7d15fe49..04510e98e0e 100644 --- a/staging/src/k8s.io/api/batch/v2alpha1/types.go +++ b/staging/src/k8s.io/api/batch/v2alpha1/types.go @@ -22,6 +22,8 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // JobTemplate describes a template for creating copies of a predefined pod. type JobTemplate struct { metav1.TypeMeta `json:",inline"` @@ -50,6 +52,7 @@ type JobTemplateSpec struct { } // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // CronJob represents the configuration of a single cron job. type CronJob struct { @@ -70,6 +73,8 @@ type CronJob struct { Status CronJobStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // CronJobList is a collection of cron jobs. type CronJobList struct { metav1.TypeMeta `json:",inline"` diff --git a/staging/src/k8s.io/api/certificates/v1beta1/types.go b/staging/src/k8s.io/api/certificates/v1beta1/types.go index a9149ba8dff..3d87535a904 100644 --- a/staging/src/k8s.io/api/certificates/v1beta1/types.go +++ b/staging/src/k8s.io/api/certificates/v1beta1/types.go @@ -24,6 +24,7 @@ import ( // +genclient=true // +nonNamespaced=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // Describes a certificate signing request type CertificateSigningRequest struct { @@ -112,6 +113,8 @@ type CertificateSigningRequestCondition struct { LastUpdateTime metav1.Time `json:"lastUpdateTime,omitempty" protobuf:"bytes,4,opt,name=lastUpdateTime"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + type CertificateSigningRequestList struct { metav1.TypeMeta `json:",inline"` // +optional diff --git a/staging/src/k8s.io/api/core/v1/types.go b/staging/src/k8s.io/api/core/v1/types.go index 4e0bdb3b486..e2d97f613f0 100644 --- a/staging/src/k8s.io/api/core/v1/types.go +++ b/staging/src/k8s.io/api/core/v1/types.go @@ -466,6 +466,7 @@ const ( // +genclient=true // +nonNamespaced=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // PersistentVolume (PV) is a storage resource provisioned by an administrator. // It is analogous to a node. @@ -551,6 +552,8 @@ type PersistentVolumeStatus struct { Reason string `json:"reason,omitempty" protobuf:"bytes,3,opt,name=reason"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // PersistentVolumeList is a list of PersistentVolume items. type PersistentVolumeList struct { metav1.TypeMeta `json:",inline"` @@ -564,6 +567,7 @@ type PersistentVolumeList struct { } // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // PersistentVolumeClaim is a user's request for and claim to a persistent volume type PersistentVolumeClaim struct { @@ -585,6 +589,8 @@ type PersistentVolumeClaim struct { Status PersistentVolumeClaimStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // PersistentVolumeClaimList is a list of PersistentVolumeClaim items. type PersistentVolumeClaimList struct { metav1.TypeMeta `json:",inline"` @@ -2653,6 +2659,8 @@ type PodStatus struct { QOSClass PodQOSClass `json:"qosClass,omitempty" protobuf:"bytes,9,rep,name=qosClass"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // PodStatusResult is a wrapper for PodStatus returned by kubelet that can be encode/decoded type PodStatusResult struct { metav1.TypeMeta `json:",inline"` @@ -2670,6 +2678,7 @@ type PodStatusResult struct { } // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // Pod is a collection of containers that can run on a host. This resource is created // by clients and scheduled onto hosts. @@ -2694,6 +2703,8 @@ type Pod struct { Status PodStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // PodList is a list of Pods. type PodList struct { metav1.TypeMeta `json:",inline"` @@ -2721,6 +2732,7 @@ type PodTemplateSpec struct { } // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // PodTemplate describes a template for creating copies of a predefined pod. type PodTemplate struct { @@ -2736,6 +2748,8 @@ type PodTemplate struct { Template PodTemplateSpec `json:"template,omitempty" protobuf:"bytes,2,opt,name=template"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // PodTemplateList is a list of PodTemplates. type PodTemplateList struct { metav1.TypeMeta `json:",inline"` @@ -2842,6 +2856,7 @@ type ReplicationControllerCondition struct { } // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // ReplicationController represents the configuration of a replication controller. type ReplicationController struct { @@ -2867,6 +2882,8 @@ type ReplicationController struct { Status ReplicationControllerStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // ReplicationControllerList is a collection of replication controllers. type ReplicationControllerList struct { metav1.TypeMeta `json:",inline"` @@ -3093,6 +3110,7 @@ type ServicePort struct { } // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // Service is a named abstraction of software service (for example, mysql) consisting of local port // (for example 3306) that the proxy listens on, and the selector that determines which pods @@ -3123,6 +3141,8 @@ const ( ClusterIPNone = "None" ) +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // ServiceList holds a list of services. type ServiceList struct { metav1.TypeMeta `json:",inline"` @@ -3136,6 +3156,7 @@ type ServiceList struct { } // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // ServiceAccount binds together: // * a name, understood by users, and perhaps by peripheral systems, for an identity @@ -3168,6 +3189,8 @@ type ServiceAccount struct { AutomountServiceAccountToken *bool `json:"automountServiceAccountToken,omitempty" protobuf:"varint,4,opt,name=automountServiceAccountToken"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // ServiceAccountList is a list of ServiceAccount objects type ServiceAccountList struct { metav1.TypeMeta `json:",inline"` @@ -3182,6 +3205,7 @@ type ServiceAccountList struct { } // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // Endpoints is a collection of endpoints that implement the actual service. Example: // Name: "mysvc", @@ -3275,6 +3299,8 @@ type EndpointPort struct { Protocol Protocol `json:"protocol,omitempty" protobuf:"bytes,3,opt,name=protocol,casttype=Protocol"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // EndpointsList is a list of endpoints. type EndpointsList struct { metav1.TypeMeta `json:",inline"` @@ -3563,6 +3589,7 @@ type ResourceList map[ResourceName]resource.Quantity // +genclient=true // +nonNamespaced=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // Node is a worker node in Kubernetes. // Each node will have a unique identifier in the cache (i.e. in etcd). @@ -3586,6 +3613,8 @@ type Node struct { Status NodeStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // NodeList is the whole list of all Nodes which have been registered with master. type NodeList struct { metav1.TypeMeta `json:",inline"` @@ -3635,6 +3664,7 @@ const ( // +genclient=true // +nonNamespaced=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // Namespace provides a scope for Names. // Use of multiple namespaces is optional. @@ -3656,6 +3686,8 @@ type Namespace struct { Status NamespaceStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // NamespaceList is a list of Namespaces. type NamespaceList struct { metav1.TypeMeta `json:",inline"` @@ -3669,6 +3701,8 @@ type NamespaceList struct { Items []Namespace `json:"items" protobuf:"bytes,2,rep,name=items"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // Binding ties one object to another; for example, a pod is bound to a node by a scheduler. // Deprecated in 1.7, please use the bindings subresource of pods instead. type Binding struct { @@ -3704,6 +3738,8 @@ const ( DeletePropagationForeground DeletionPropagation = "Foreground" ) +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // DeleteOptions may be provided when deleting an API object // DEPRECATED: This type has been moved to meta/v1 and will be removed soon. // +k8s:openapi-gen=false @@ -3737,6 +3773,8 @@ type DeleteOptions struct { PropagationPolicy *DeletionPropagation `protobuf:"bytes,4,opt,name=propagationPolicy,casttype=DeletionPropagation"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // ListOptions is the query options to a standard REST list call. // DEPRECATED: This type has been moved to meta/v1 and will be removed soon. // +k8s:openapi-gen=false @@ -3771,6 +3809,8 @@ type ListOptions struct { TimeoutSeconds *int64 `json:"timeoutSeconds,omitempty" protobuf:"varint,5,opt,name=timeoutSeconds"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // PodLogOptions is the query options for a Pod's logs REST call. type PodLogOptions struct { metav1.TypeMeta `json:",inline"` @@ -3811,6 +3851,8 @@ type PodLogOptions struct { LimitBytes *int64 `json:"limitBytes,omitempty" protobuf:"varint,8,opt,name=limitBytes"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // PodAttachOptions is the query options to a Pod's remote attach call. // --- // TODO: merge w/ PodExecOptions below for stdin, stdout, etc @@ -3846,6 +3888,8 @@ type PodAttachOptions struct { Container string `json:"container,omitempty" protobuf:"bytes,5,opt,name=container"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // PodExecOptions is the query options to a Pod's remote exec call. // --- // TODO: This is largely identical to PodAttachOptions above, make sure they stay in sync and see about merging @@ -3882,6 +3926,8 @@ type PodExecOptions struct { Command []string `json:"command" protobuf:"bytes,6,rep,name=command"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // PodPortForwardOptions is the query options to a Pod's port forward call // when using WebSockets. // The `port` query parameter must specify the port or @@ -3897,6 +3943,8 @@ type PodPortForwardOptions struct { Ports []int32 `json:"ports,omitempty" protobuf:"varint,1,rep,name=ports"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // PodProxyOptions is the query options to a Pod's proxy call. type PodProxyOptions struct { metav1.TypeMeta `json:",inline"` @@ -3906,6 +3954,8 @@ type PodProxyOptions struct { Path string `json:"path,omitempty" protobuf:"bytes,1,opt,name=path"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // NodeProxyOptions is the query options to a Node's proxy call. type NodeProxyOptions struct { metav1.TypeMeta `json:",inline"` @@ -3915,6 +3965,8 @@ type NodeProxyOptions struct { Path string `json:"path,omitempty" protobuf:"bytes,1,opt,name=path"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // ServiceProxyOptions is the query options to a Service's proxy call. type ServiceProxyOptions struct { metav1.TypeMeta `json:",inline"` @@ -3929,6 +3981,7 @@ type ServiceProxyOptions struct { } // ObjectReference contains enough information to let you inspect or modify the referred object. +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type ObjectReference struct { // Kind of the referent. // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds @@ -3976,6 +4029,8 @@ type LocalObjectReference struct { Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // SerializedReference is a reference to serialized object. type SerializedReference struct { metav1.TypeMeta `json:",inline"` @@ -4003,6 +4058,7 @@ const ( ) // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // Event is a report of an event somewhere in the cluster. // TODO: Decide whether to store these separately or with the object they apply to. @@ -4047,6 +4103,8 @@ type Event struct { Type string `json:"type,omitempty" protobuf:"bytes,9,opt,name=type"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // EventList is a list of events. type EventList struct { metav1.TypeMeta `json:",inline"` @@ -4059,6 +4117,8 @@ type EventList struct { Items []Event `json:"items" protobuf:"bytes,2,rep,name=items"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // List holds a list of objects, which may not be known by the server. type List struct { metav1.TypeMeta `json:",inline"` @@ -4112,6 +4172,7 @@ type LimitRangeSpec struct { } // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // LimitRange sets resource usage limits for each kind of resource in a Namespace. type LimitRange struct { @@ -4127,6 +4188,8 @@ type LimitRange struct { Spec LimitRangeSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // LimitRangeList is a list of LimitRange items. type LimitRangeList struct { metav1.TypeMeta `json:",inline"` @@ -4210,6 +4273,7 @@ type ResourceQuotaStatus struct { } // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // ResourceQuota sets aggregate quota restrictions enforced per namespace type ResourceQuota struct { @@ -4230,6 +4294,8 @@ type ResourceQuota struct { Status ResourceQuotaStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // ResourceQuotaList is a list of ResourceQuota items. type ResourceQuotaList struct { metav1.TypeMeta `json:",inline"` @@ -4244,6 +4310,7 @@ type ResourceQuotaList struct { } // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // Secret holds secret data of a certain type. The total bytes of the values in // the Data field must be less than MaxSecretSize bytes. @@ -4357,6 +4424,8 @@ const ( TLSPrivateKeyKey = "tls.key" ) +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // SecretList is a list of Secret. type SecretList struct { metav1.TypeMeta `json:",inline"` @@ -4371,6 +4440,7 @@ type SecretList struct { } // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // ConfigMap holds configuration data for pods to consume. type ConfigMap struct { @@ -4386,6 +4456,8 @@ type ConfigMap struct { Data map[string]string `json:"data,omitempty" protobuf:"bytes,2,rep,name=data"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // ConfigMapList is a resource containing a list of ConfigMap objects. type ConfigMapList struct { metav1.TypeMeta `json:",inline"` @@ -4426,6 +4498,7 @@ type ComponentCondition struct { // +genclient=true // +nonNamespaced=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // ComponentStatus (and ComponentStatusList) holds the cluster validation info. type ComponentStatus struct { @@ -4442,6 +4515,8 @@ type ComponentStatus struct { Conditions []ComponentCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,2,rep,name=conditions"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // Status of all the conditions for the component as a list of ComponentStatus objects. type ComponentStatusList struct { metav1.TypeMeta `json:",inline"` @@ -4556,6 +4631,8 @@ type SELinuxOptions struct { Level string `json:"level,omitempty" protobuf:"bytes,4,opt,name=level"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // RangeAllocation is not a public type. type RangeAllocation struct { metav1.TypeMeta `json:",inline"` diff --git a/staging/src/k8s.io/api/extensions/v1beta1/types.go b/staging/src/k8s.io/api/extensions/v1beta1/types.go index 11d1a8f711d..7530caaee3b 100644 --- a/staging/src/k8s.io/api/extensions/v1beta1/types.go +++ b/staging/src/k8s.io/api/extensions/v1beta1/types.go @@ -52,6 +52,7 @@ type ScaleStatus struct { // +genclient=true // +noMethods=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // represents a scaling request for a resource. type Scale struct { @@ -69,6 +70,8 @@ type Scale struct { Status ScaleStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // Dummy definition type ReplicationControllerDummy struct { metav1.TypeMeta `json:",inline"` @@ -99,6 +102,7 @@ type CustomMetricCurrentStatusList struct { // +genclient=true // +nonNamespaced=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // A ThirdPartyResource is a generic representation of a resource, it is used by add-ons and plugins to add new resource // types to the API. It consists of one or more Versions of the api. @@ -118,6 +122,8 @@ type ThirdPartyResource struct { Versions []APIVersion `json:"versions,omitempty" protobuf:"bytes,3,rep,name=versions"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // ThirdPartyResourceList is a list of ThirdPartyResources. type ThirdPartyResourceList struct { metav1.TypeMeta `json:",inline"` @@ -137,6 +143,8 @@ type APIVersion struct { Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // An internal object, used for versioned storage in etcd. Not exposed to the end user. type ThirdPartyResourceData struct { metav1.TypeMeta `json:",inline"` @@ -150,6 +158,7 @@ type ThirdPartyResourceData struct { } // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // Deployment enables declarative updates for Pods and ReplicaSets. type Deployment struct { @@ -216,6 +225,8 @@ type DeploymentSpec struct { ProgressDeadlineSeconds *int32 `json:"progressDeadlineSeconds,omitempty" protobuf:"varint,9,opt,name=progressDeadlineSeconds"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // DeploymentRollback stores the information required to rollback a deployment. type DeploymentRollback struct { metav1.TypeMeta `json:",inline"` @@ -367,6 +378,8 @@ type DeploymentCondition struct { Message string `json:"message,omitempty" protobuf:"bytes,5,opt,name=message"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // DeploymentList is a list of Deployments. type DeploymentList struct { metav1.TypeMeta `json:",inline"` @@ -512,6 +525,7 @@ type DaemonSetStatus struct { } // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // DaemonSet represents the configuration of a daemon set. type DaemonSet struct { @@ -548,6 +562,8 @@ const ( DefaultDaemonSetUniqueLabelKey = appsv1beta1.ControllerRevisionHashLabelKey ) +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // DaemonSetList is a collection of daemon sets. type DaemonSetList struct { metav1.TypeMeta `json:",inline"` @@ -560,6 +576,8 @@ type DaemonSetList struct { Items []DaemonSet `json:"items" protobuf:"bytes,2,rep,name=items"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // ThirdPartyResrouceDataList is a list of ThirdPartyResourceData. type ThirdPartyResourceDataList struct { metav1.TypeMeta `json:",inline"` @@ -573,6 +591,7 @@ type ThirdPartyResourceDataList struct { } // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // Ingress is a collection of rules that allow inbound connections to reach the // endpoints defined by a backend. An Ingress can be configured to give services @@ -596,6 +615,8 @@ type Ingress struct { Status IngressStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // IngressList is a collection of Ingress. type IngressList struct { metav1.TypeMeta `json:",inline"` @@ -739,6 +760,7 @@ type IngressBackend struct { } // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // ReplicaSet represents the configuration of a ReplicaSet. type ReplicaSet struct { @@ -764,6 +786,8 @@ type ReplicaSet struct { Status ReplicaSetStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // ReplicaSetList is a collection of ReplicaSets. type ReplicaSetList struct { metav1.TypeMeta `json:",inline"` @@ -864,6 +888,7 @@ type ReplicaSetCondition struct { // +genclient=true // +nonNamespaced=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // Pod Security Policy governs the ability to make requests that affect the Security Context // that will be applied to a pod and container. @@ -1063,6 +1088,8 @@ const ( SupplementalGroupsStrategyRunAsAny SupplementalGroupsStrategyType = "RunAsAny" ) +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // Pod Security Policy List is a list of PodSecurityPolicy objects. type PodSecurityPolicyList struct { metav1.TypeMeta `json:",inline"` @@ -1075,6 +1102,8 @@ type PodSecurityPolicyList struct { Items []PodSecurityPolicy `json:"items" protobuf:"bytes,2,rep,name=items"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // NetworkPolicy describes what network traffic is allowed for a set of Pods type NetworkPolicy struct { metav1.TypeMeta `json:",inline"` @@ -1158,6 +1187,8 @@ type NetworkPolicyPeer struct { NamespaceSelector *metav1.LabelSelector `json:"namespaceSelector,omitempty" protobuf:"bytes,2,opt,name=namespaceSelector"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // Network Policy List is a list of NetworkPolicy objects. type NetworkPolicyList struct { metav1.TypeMeta `json:",inline"` diff --git a/staging/src/k8s.io/api/imagepolicy/v1alpha1/types.go b/staging/src/k8s.io/api/imagepolicy/v1alpha1/types.go index 483e18ff38e..b90711dd172 100644 --- a/staging/src/k8s.io/api/imagepolicy/v1alpha1/types.go +++ b/staging/src/k8s.io/api/imagepolicy/v1alpha1/types.go @@ -23,6 +23,7 @@ import ( // +genclient=true // +nonNamespaced=true // +noMethods=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // ImageReview checks if the set of images in a pod are allowed. type ImageReview struct { diff --git a/staging/src/k8s.io/api/networking/v1/types.go b/staging/src/k8s.io/api/networking/v1/types.go index 1dad06ee590..55e57436e17 100644 --- a/staging/src/k8s.io/api/networking/v1/types.go +++ b/staging/src/k8s.io/api/networking/v1/types.go @@ -23,6 +23,7 @@ import ( ) // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // NetworkPolicy describes what network traffic is allowed for a set of Pods type NetworkPolicy struct { @@ -107,6 +108,8 @@ type NetworkPolicyPeer struct { NamespaceSelector *metav1.LabelSelector `json:"namespaceSelector,omitempty" protobuf:"bytes,2,opt,name=namespaceSelector"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // NetworkPolicyList is a list of NetworkPolicy objects. type NetworkPolicyList struct { metav1.TypeMeta `json:",inline"` diff --git a/staging/src/k8s.io/api/policy/v1beta1/types.go b/staging/src/k8s.io/api/policy/v1beta1/types.go index 6cc56256a6c..e6dce5add96 100644 --- a/staging/src/k8s.io/api/policy/v1beta1/types.go +++ b/staging/src/k8s.io/api/policy/v1beta1/types.go @@ -75,6 +75,7 @@ type PodDisruptionBudgetStatus struct { } // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods type PodDisruptionBudget struct { @@ -87,6 +88,8 @@ type PodDisruptionBudget struct { Status PodDisruptionBudgetStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // PodDisruptionBudgetList is a collection of PodDisruptionBudgets. type PodDisruptionBudgetList struct { metav1.TypeMeta `json:",inline"` @@ -96,6 +99,7 @@ type PodDisruptionBudgetList struct { // +genclient=true // +noMethods=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // Eviction evicts a pod from its node subject to certain policies and safety constraints. // This is a subresource of Pod. A request to cause such an eviction is diff --git a/staging/src/k8s.io/api/rbac/v1alpha1/types.go b/staging/src/k8s.io/api/rbac/v1alpha1/types.go index e9f8efb3b47..e4618fe4d1f 100644 --- a/staging/src/k8s.io/api/rbac/v1alpha1/types.go +++ b/staging/src/k8s.io/api/rbac/v1alpha1/types.go @@ -100,6 +100,7 @@ type RoleRef struct { } // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding. type Role struct { @@ -113,6 +114,7 @@ type Role struct { } // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // RoleBinding references a role, but does not contain it. It can reference a Role in the same namespace or a ClusterRole in the global namespace. // It adds who information via Subjects and namespace information by which namespace it exists in. RoleBindings in a given @@ -131,6 +133,8 @@ type RoleBinding struct { RoleRef RoleRef `json:"roleRef" protobuf:"bytes,3,opt,name=roleRef"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // RoleBindingList is a collection of RoleBindings type RoleBindingList struct { metav1.TypeMeta `json:",inline"` @@ -142,6 +146,8 @@ type RoleBindingList struct { Items []RoleBinding `json:"items" protobuf:"bytes,2,rep,name=items"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // RoleList is a collection of Roles type RoleList struct { metav1.TypeMeta `json:",inline"` @@ -155,6 +161,7 @@ type RoleList struct { // +genclient=true // +nonNamespaced=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding. type ClusterRole struct { @@ -169,6 +176,7 @@ type ClusterRole struct { // +genclient=true // +nonNamespaced=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // ClusterRoleBinding references a ClusterRole, but not contain it. It can reference a ClusterRole in the global namespace, // and adds who information via Subject. @@ -186,6 +194,8 @@ type ClusterRoleBinding struct { RoleRef RoleRef `json:"roleRef" protobuf:"bytes,3,opt,name=roleRef"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // ClusterRoleBindingList is a collection of ClusterRoleBindings type ClusterRoleBindingList struct { metav1.TypeMeta `json:",inline"` @@ -197,6 +207,8 @@ type ClusterRoleBindingList struct { Items []ClusterRoleBinding `json:"items" protobuf:"bytes,2,rep,name=items"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // ClusterRoleList is a collection of ClusterRoles type ClusterRoleList struct { metav1.TypeMeta `json:",inline"` diff --git a/staging/src/k8s.io/api/rbac/v1beta1/types.go b/staging/src/k8s.io/api/rbac/v1beta1/types.go index 89a47db9e38..0d9a9aaf3c0 100644 --- a/staging/src/k8s.io/api/rbac/v1beta1/types.go +++ b/staging/src/k8s.io/api/rbac/v1beta1/types.go @@ -98,6 +98,7 @@ type RoleRef struct { } // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding. type Role struct { @@ -111,6 +112,7 @@ type Role struct { } // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // RoleBinding references a role, but does not contain it. It can reference a Role in the same namespace or a ClusterRole in the global namespace. // It adds who information via Subjects and namespace information by which namespace it exists in. RoleBindings in a given @@ -129,6 +131,8 @@ type RoleBinding struct { RoleRef RoleRef `json:"roleRef" protobuf:"bytes,3,opt,name=roleRef"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // RoleBindingList is a collection of RoleBindings type RoleBindingList struct { metav1.TypeMeta `json:",inline"` @@ -140,6 +144,8 @@ type RoleBindingList struct { Items []RoleBinding `json:"items" protobuf:"bytes,2,rep,name=items"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // RoleList is a collection of Roles type RoleList struct { metav1.TypeMeta `json:",inline"` @@ -153,6 +159,7 @@ type RoleList struct { // +genclient=true // +nonNamespaced=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding. type ClusterRole struct { @@ -167,6 +174,7 @@ type ClusterRole struct { // +genclient=true // +nonNamespaced=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // ClusterRoleBinding references a ClusterRole, but not contain it. It can reference a ClusterRole in the global namespace, // and adds who information via Subject. @@ -184,6 +192,8 @@ type ClusterRoleBinding struct { RoleRef RoleRef `json:"roleRef" protobuf:"bytes,3,opt,name=roleRef"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // ClusterRoleBindingList is a collection of ClusterRoleBindings type ClusterRoleBindingList struct { metav1.TypeMeta `json:",inline"` @@ -195,6 +205,8 @@ type ClusterRoleBindingList struct { Items []ClusterRoleBinding `json:"items" protobuf:"bytes,2,rep,name=items"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // ClusterRoleList is a collection of ClusterRoles type ClusterRoleList struct { metav1.TypeMeta `json:",inline"` diff --git a/staging/src/k8s.io/api/settings/v1alpha1/types.go b/staging/src/k8s.io/api/settings/v1alpha1/types.go index 35ede189755..c972b2b0163 100644 --- a/staging/src/k8s.io/api/settings/v1alpha1/types.go +++ b/staging/src/k8s.io/api/settings/v1alpha1/types.go @@ -22,6 +22,7 @@ import ( ) // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // PodPreset is a policy resource that defines additional runtime // requirements for a Pod. @@ -54,6 +55,8 @@ type PodPresetSpec struct { VolumeMounts []v1.VolumeMount `json:"volumeMounts,omitempty" protobuf:"bytes,5,rep,name=volumeMounts"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // PodPresetList is a list of PodPreset objects. type PodPresetList struct { metav1.TypeMeta `json:",inline"` diff --git a/staging/src/k8s.io/api/storage/v1/types.go b/staging/src/k8s.io/api/storage/v1/types.go index 971db769e03..0fc15c1f3db 100644 --- a/staging/src/k8s.io/api/storage/v1/types.go +++ b/staging/src/k8s.io/api/storage/v1/types.go @@ -22,6 +22,7 @@ import ( // +genclient=true // +nonNamespaced=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // StorageClass describes the parameters for a class of storage for // which PersistentVolumes can be dynamically provisioned. @@ -44,6 +45,8 @@ type StorageClass struct { Parameters map[string]string `json:"parameters,omitempty" protobuf:"bytes,3,rep,name=parameters"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // StorageClassList is a collection of storage classes. type StorageClassList struct { metav1.TypeMeta `json:",inline"` diff --git a/staging/src/k8s.io/api/storage/v1beta1/types.go b/staging/src/k8s.io/api/storage/v1beta1/types.go index 8b475678498..a5dedb3ad34 100644 --- a/staging/src/k8s.io/api/storage/v1beta1/types.go +++ b/staging/src/k8s.io/api/storage/v1beta1/types.go @@ -22,6 +22,7 @@ import ( // +genclient=true // +nonNamespaced=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // StorageClass describes the parameters for a class of storage for // which PersistentVolumes can be dynamically provisioned. @@ -44,6 +45,8 @@ type StorageClass struct { Parameters map[string]string `json:"parameters,omitempty" protobuf:"bytes,3,rep,name=parameters"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // StorageClassList is a collection of storage classes. type StorageClassList struct { metav1.TypeMeta `json:",inline"` diff --git a/staging/src/k8s.io/apiextensions-apiserver/examples/client-go/apis/cr/v1/types.go b/staging/src/k8s.io/apiextensions-apiserver/examples/client-go/apis/cr/v1/types.go index 32fea5a5347..03ff9495638 100644 --- a/staging/src/k8s.io/apiextensions-apiserver/examples/client-go/apis/cr/v1/types.go +++ b/staging/src/k8s.io/apiextensions-apiserver/examples/client-go/apis/cr/v1/types.go @@ -22,6 +22,7 @@ import ( const ExampleResourcePlural = "examples" +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type Example struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata"` @@ -46,6 +47,7 @@ const ( ExampleStateProcessed ExampleState = "Processed" ) +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type ExampleList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata"` diff --git a/staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/types.go b/staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/types.go index 55c3bfad46d..85a914cbd46 100644 --- a/staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/types.go +++ b/staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/types.go @@ -115,6 +115,7 @@ const CustomResourceCleanupFinalizer = "customresourcecleanup.apiextensions.k8s. // +genclient=true // +nonNamespaced=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // CustomResourceDefinition represents a resource that should be exposed on the API server. Its name MUST be in the format // <.spec.name>.<.spec.group>. @@ -128,6 +129,8 @@ type CustomResourceDefinition struct { Status CustomResourceDefinitionStatus } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // CustomResourceDefinitionList is a list of CustomResourceDefinition objects. type CustomResourceDefinitionList struct { metav1.TypeMeta diff --git a/staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/types.go b/staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/types.go index a9a93c37f9f..d9aa7e3f9bc 100644 --- a/staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/types.go +++ b/staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/types.go @@ -115,6 +115,7 @@ const CustomResourceCleanupFinalizer = "customresourcecleanup.apiextensions.k8s. // +genclient=true // +nonNamespaced=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // CustomResourceDefinition represents a resource that should be exposed on the API server. Its name MUST be in the format // <.spec.name>.<.spec.group>. @@ -128,6 +129,8 @@ type CustomResourceDefinition struct { Status CustomResourceDefinitionStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // CustomResourceDefinitionList is a list of CustomResourceDefinition objects. type CustomResourceDefinitionList struct { metav1.TypeMeta `json:",inline"` diff --git a/staging/src/k8s.io/apimachinery/pkg/api/errors/errors_test.go b/staging/src/k8s.io/apimachinery/pkg/api/errors/errors_test.go index c488d2d24cf..ab14e7af9a1 100644 --- a/staging/src/k8s.io/apimachinery/pkg/api/errors/errors_test.go +++ b/staging/src/k8s.io/apimachinery/pkg/api/errors/errors_test.go @@ -178,6 +178,13 @@ func Test_reasonForError(t *testing.T) { type TestType struct{} func (obj *TestType) GetObjectKind() schema.ObjectKind { return schema.EmptyObjectKind } +func (obj *TestType) DeepCopyObject() runtime.Object { + if obj == nil { + return nil + } + clone := *obj + return &clone +} func TestFromObject(t *testing.T) { table := []struct { diff --git a/staging/src/k8s.io/apimachinery/pkg/apis/meta/internalversion/doc.go b/staging/src/k8s.io/apimachinery/pkg/apis/meta/internalversion/doc.go new file mode 100644 index 00000000000..6ee8dd66d2c --- /dev/null +++ b/staging/src/k8s.io/apimachinery/pkg/apis/meta/internalversion/doc.go @@ -0,0 +1,19 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// +k8s:deepcopy-gen=package + +package internalversion diff --git a/staging/src/k8s.io/apimachinery/pkg/apis/meta/internalversion/types.go b/staging/src/k8s.io/apimachinery/pkg/apis/meta/internalversion/types.go index 0aa4188df2d..4044f4e8e31 100644 --- a/staging/src/k8s.io/apimachinery/pkg/apis/meta/internalversion/types.go +++ b/staging/src/k8s.io/apimachinery/pkg/apis/meta/internalversion/types.go @@ -22,6 +22,8 @@ import ( "k8s.io/apimachinery/pkg/labels" ) +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // ListOptions is the query options to a standard REST list call, and has future support for // watch calls. type ListOptions struct { diff --git a/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/time.go b/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/time.go index a1e01f34431..49d2ac18ec2 100644 --- a/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/time.go +++ b/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/time.go @@ -37,11 +37,11 @@ type Time struct { time.Time `protobuf:"-"` } -// DeepCopy returns a deep-copy of the Time value. The underlying time.Time +// DeepCopyInto creates a deep-copy of the Time value. The underlying time.Time // type is effectively immutable in the time API, so it is safe to // copy-by-assign, despite the presence of (unexported) Pointer fields. -func (t Time) DeepCopy() Time { - return t +func (t *Time) DeepCopyInto(out *Time) { + *out = *t } // String returns the representation of the time. diff --git a/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/types.go b/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/types.go index c5ac31f7916..14c7255c92b 100644 --- a/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/types.go +++ b/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/types.go @@ -35,6 +35,8 @@ import ( // TypeMeta describes an individual object in an API response or request // with strings representing the type of the object and its API schema version. // Structures that are versioned or persisted should inline TypeMeta. +// +// +k8s:deepcopy-gen=false type TypeMeta struct { // Kind is a string value representing the REST resource this object represents. // Servers may infer this from the endpoint the client submits requests to. @@ -298,6 +300,8 @@ type OwnerReference struct { BlockOwnerDeletion *bool `json:"blockOwnerDeletion,omitempty" protobuf:"varint,7,opt,name=blockOwnerDeletion"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // ListOptions is the query options to a standard REST list call. type ListOptions struct { TypeMeta `json:",inline"` @@ -330,6 +334,8 @@ type ListOptions struct { TimeoutSeconds *int64 `json:"timeoutSeconds,omitempty" protobuf:"varint,5,opt,name=timeoutSeconds"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // ExportOptions is the query options to the standard REST get call. type ExportOptions struct { TypeMeta `json:",inline"` @@ -339,6 +345,8 @@ type ExportOptions struct { Exact bool `json:"exact" protobuf:"varint,2,opt,name=exact"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // GetOptions is the standard query options to the standard REST get call. type GetOptions struct { TypeMeta `json:",inline"` @@ -370,6 +378,8 @@ const ( DeletePropagationForeground DeletionPropagation = "Foreground" ) +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // DeleteOptions may be provided when deleting an API object. type DeleteOptions struct { TypeMeta `json:",inline"` @@ -408,6 +418,8 @@ type Preconditions struct { UID *types.UID `json:"uid,omitempty" protobuf:"bytes,1,opt,name=uid,casttype=k8s.io/apimachinery/pkg/types.UID"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // Status is a return value for calls that don't return other objects. type Status struct { TypeMeta `json:",inline"` @@ -660,6 +672,7 @@ const ( // discover the API at /api, which is the root path of the legacy v1 API. // // +protobuf.options.(gogoproto.goproto_stringer)=false +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type APIVersions struct { TypeMeta `json:",inline"` // versions are the api versions that are available. @@ -674,6 +687,8 @@ type APIVersions struct { ServerAddressByClientCIDRs []ServerAddressByClientCIDR `json:"serverAddressByClientCIDRs" protobuf:"bytes,2,rep,name=serverAddressByClientCIDRs"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // APIGroupList is a list of APIGroup, to allow clients to discover the API at // /apis. type APIGroupList struct { @@ -682,6 +697,8 @@ type APIGroupList struct { Groups []APIGroup `json:"groups" protobuf:"bytes,1,rep,name=groups"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // APIGroup contains the name, the supported versions, and the preferred version // of a group. type APIGroup struct { @@ -754,6 +771,8 @@ func (vs Verbs) String() string { return fmt.Sprintf("%v", []string(vs)) } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // APIResourceList is a list of APIResource, it is used to expose the name of the // resources supported in a specific group and version, and if the resource // is namespaced. diff --git a/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured/unstructured.go b/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured/unstructured.go index 5d1aeb0bcb9..c6638c218cf 100644 --- a/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured/unstructured.go +++ b/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured/unstructured.go @@ -43,6 +43,8 @@ import ( // type if you are dealing with objects that are not in the server meta v1 schema. // // TODO: make the serialization part of this type distinct from the field accessors. +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:deepcopy-gen=true type Unstructured struct { // Object is a JSON compatible map with string, float, int, bool, []interface{}, or // map[string]interface{} @@ -143,6 +145,50 @@ func (u *Unstructured) UnmarshalJSON(b []byte) error { return err } +func deepCopyJSON(x interface{}) interface{} { + switch x := x.(type) { + case map[string]interface{}: + clone := make(map[string]interface{}, len(x)) + for k, v := range x { + clone[k] = deepCopyJSON(v) + } + return clone + case []interface{}: + clone := make([]interface{}, len(x)) + for i := range x { + clone[i] = deepCopyJSON(x[i]) + } + return clone + default: + // only non-pointer values (float64, int64, bool, string) are left. These can be copied by-value. + return x + } +} + +func (in *Unstructured) DeepCopy() *Unstructured { + if in == nil { + return nil + } + out := new(Unstructured) + *out = *in + out.Object = deepCopyJSON(in.Object).(map[string]interface{}) + return out +} + +func (in *UnstructuredList) DeepCopy() *UnstructuredList { + if in == nil { + return nil + } + out := new(UnstructuredList) + *out = *in + out.Object = deepCopyJSON(in.Object).(map[string]interface{}) + out.Items = make([]Unstructured, len(in.Items)) + for i := range in.Items { + in.Items[i].DeepCopyInto(&out.Items[i]) + } + return out +} + func getNestedField(obj map[string]interface{}, fields ...string) interface{} { var val interface{} = obj for _, field := range fields { @@ -541,6 +587,8 @@ func (u *Unstructured) SetClusterName(clusterName string) { // UnstructuredList allows lists that do not have Golang structs // registered to be manipulated generically. This can be used to deal // with the API lists from a plug-in. +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:deepcopy-gen=true type UnstructuredList struct { Object map[string]interface{} diff --git a/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/watch.go b/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/watch.go index a645501a1a0..b7ec5031846 100644 --- a/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/watch.go +++ b/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/watch.go @@ -26,6 +26,8 @@ import ( // Event represents a single event to a watched resource. // // +protobuf=true +// +k8s:deepcopy-gen=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type WatchEvent struct { Type string `json:"type" protobuf:"bytes,1,opt,name=type"` @@ -78,3 +80,10 @@ type InternalEvent watch.Event func (e *InternalEvent) GetObjectKind() schema.ObjectKind { return schema.EmptyObjectKind } func (e *WatchEvent) GetObjectKind() schema.ObjectKind { return schema.EmptyObjectKind } +func (e *InternalEvent) DeepCopyObject() runtime.Object { + if c := e.DeepCopy(); c != nil { + return c + } else { + return nil + } +} diff --git a/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1alpha1/deepcopy.go b/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1alpha1/deepcopy.go new file mode 100644 index 00000000000..de5f5a25470 --- /dev/null +++ b/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1alpha1/deepcopy.go @@ -0,0 +1,61 @@ +/* +Copyright 2017 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +func (in *TableRow) DeepCopy() *TableRow { + if in == nil { + return nil + } + + out := new(TableRow) + + if out.Cells != nil { + out.Cells = make([]interface{}, len(in.Cells)) + for i := range in.Cells { + out.Cells[i] = deepCopyJSON(in.Cells[i]) + } + } + + if out.Conditions != nil { + out.Conditions = make([]TableRowCondition, len(in.Conditions)) + for i := range in.Conditions { + in.Conditions[i].DeepCopyInto(&out.Conditions[i]) + } + } + + in.Object.DeepCopyInto(&out.Object) + return out +} + +func deepCopyJSON(x interface{}) interface{} { + switch x := x.(type) { + case map[string]interface{}: + clone := make(map[string]interface{}, len(x)) + for k, v := range x { + clone[k] = deepCopyJSON(v) + } + return clone + case []interface{}: + clone := make([]interface{}, len(x)) + for i := range x { + clone[i] = deepCopyJSON(x[i]) + } + return clone + default: + return x + } +} diff --git a/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1alpha1/types.go b/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1alpha1/types.go index ef99218061e..9c3c2a35e41 100644 --- a/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1alpha1/types.go +++ b/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1alpha1/types.go @@ -28,6 +28,7 @@ import ( // Table is a tabular representation of a set of API resources. The server transforms the // object into a set of preferred columns for quickly reviewing the objects. // +protobuf=false +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type Table struct { v1.TypeMeta `json:",inline"` // Standard list metadata. @@ -129,6 +130,7 @@ const ( ) // TableOptions are used when a Table is requested by the caller. +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type TableOptions struct { v1.TypeMeta `json:",inline"` // includeObject decides whether to include each object along with its columnar information. @@ -140,6 +142,7 @@ type TableOptions struct { // PartialObjectMetadata is a generic representation of any object with ObjectMeta. It allows clients // to get access to a particular ObjectMeta schema without knowing the details of the version. +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type PartialObjectMetadata struct { v1.TypeMeta `json:",inline"` // Standard object's metadata. @@ -149,6 +152,7 @@ type PartialObjectMetadata struct { } // PartialObjectMetadataList contains a list of objects containing only their metadata +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type PartialObjectMetadataList struct { v1.TypeMeta `json:",inline"` diff --git a/staging/src/k8s.io/apimachinery/pkg/apis/testapigroup/types.go b/staging/src/k8s.io/apimachinery/pkg/apis/testapigroup/types.go index 3a63e899ec0..25bd0eb9d9f 100644 --- a/staging/src/k8s.io/apimachinery/pkg/apis/testapigroup/types.go +++ b/staging/src/k8s.io/apimachinery/pkg/apis/testapigroup/types.go @@ -27,6 +27,8 @@ type ( RestartPolicy string ) +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // Carp is a collection of containers, used as either input (create, update) or as output (list, get). type Carp struct { metav1.TypeMeta @@ -124,6 +126,8 @@ type CarpSpec struct { SchedulerName string } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // CarpList is a list of Carps. type CarpList struct { metav1.TypeMeta diff --git a/staging/src/k8s.io/apimachinery/pkg/apis/testapigroup/v1/types.go b/staging/src/k8s.io/apimachinery/pkg/apis/testapigroup/v1/types.go index 995a28a7ed0..cd505e007d0 100644 --- a/staging/src/k8s.io/apimachinery/pkg/apis/testapigroup/v1/types.go +++ b/staging/src/k8s.io/apimachinery/pkg/apis/testapigroup/v1/types.go @@ -27,6 +27,8 @@ type ( RestartPolicy string ) +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // Carp is a collection of containers, used as either input (create, update) or as output (list, get). type Carp struct { metav1.TypeMeta `json:",inline"` @@ -178,6 +180,8 @@ type CarpSpec struct { SchedulerName string `json:"schedulername,omitempty" protobuf:"bytes,19,opt,name=schedulername"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // CarpList is a list of Carps. type CarpList struct { metav1.TypeMeta `json:",inline"` diff --git a/staging/src/k8s.io/apimachinery/pkg/fields/selector.go b/staging/src/k8s.io/apimachinery/pkg/fields/selector.go index 1305dde086c..273e9a2c1b5 100644 --- a/staging/src/k8s.io/apimachinery/pkg/fields/selector.go +++ b/staging/src/k8s.io/apimachinery/pkg/fields/selector.go @@ -50,6 +50,9 @@ type Selector interface { // String returns a human readable string that represents this selector. String() string + + // Make a deep copy of the selector. + DeepCopySelector() Selector } // Everything returns a selector that matches all fields. @@ -99,6 +102,15 @@ func (t *hasTerm) String() string { return fmt.Sprintf("%v=%v", t.field, EscapeValue(t.value)) } +func (t *hasTerm) DeepCopySelector() Selector { + if t == nil { + return nil + } + out := new(hasTerm) + *out = *t + return out +} + type notHasTerm struct { field, value string } @@ -138,6 +150,15 @@ func (t *notHasTerm) String() string { return fmt.Sprintf("%v!=%v", t.field, EscapeValue(t.value)) } +func (t *notHasTerm) DeepCopySelector() Selector { + if t == nil { + return nil + } + out := new(notHasTerm) + *out = *t + return out +} + type andTerm []Selector func (t andTerm) Matches(ls Fields) bool { @@ -207,6 +228,17 @@ func (t andTerm) String() string { return strings.Join(terms, ",") } +func (t andTerm) DeepCopySelector() Selector { + if t == nil { + return nil + } + out := make([]Selector, len(t)) + for i := range t { + out[i] = t[i].DeepCopySelector() + } + return andTerm(out) +} + // SelectorFromSet returns a Selector which will match exactly the given Set. A // nil Set is considered equivalent to Everything(). func SelectorFromSet(ls Set) Selector { diff --git a/staging/src/k8s.io/apimachinery/pkg/labels/selector.go b/staging/src/k8s.io/apimachinery/pkg/labels/selector.go index 50b41f99d28..ac123033a0f 100644 --- a/staging/src/k8s.io/apimachinery/pkg/labels/selector.go +++ b/staging/src/k8s.io/apimachinery/pkg/labels/selector.go @@ -51,6 +51,9 @@ type Selector interface { // If there are querying parameters, it will return converted requirements and selectable=true. // If this selector doesn't want to select anything, it will return selectable=false. Requirements() (requirements Requirements, selectable bool) + + // Make a deep copy of the selector. + DeepCopySelector() Selector } // Everything returns a selector that matches all labels. @@ -65,6 +68,7 @@ func (n nothingSelector) Empty() bool { return false } func (n nothingSelector) String() string { return "" } func (n nothingSelector) Add(_ ...Requirement) Selector { return n } func (n nothingSelector) Requirements() (Requirements, bool) { return nil, false } +func (n nothingSelector) DeepCopySelector() Selector { return n } // Nothing returns a selector that matches no labels func Nothing() Selector { @@ -78,6 +82,21 @@ func NewSelector() Selector { type internalSelector []Requirement +func (s internalSelector) DeepCopy() internalSelector { + if s == nil { + return nil + } + result := make([]Requirement, len(s)) + for i := range s { + s[i].DeepCopyInto(&result[i]) + } + return result +} + +func (s internalSelector) DeepCopySelector() Selector { + return s.DeepCopy() +} + // ByKey sorts requirements by key to obtain deterministic parser type ByKey []Requirement @@ -91,6 +110,7 @@ func (a ByKey) Less(i, j int) bool { return a[i].key < a[j].key } // The zero value of Requirement is invalid. // Requirement implements both set based match and exact match // Requirement should be initialized via NewRequirement constructor for creating a valid Requirement. +// +k8s:deepcopy-gen=true type Requirement struct { key string operator selection.Operator diff --git a/staging/src/k8s.io/apimachinery/pkg/runtime/embedded.go b/staging/src/k8s.io/apimachinery/pkg/runtime/embedded.go index e8825a787a3..2cdac9e141f 100644 --- a/staging/src/k8s.io/apimachinery/pkg/runtime/embedded.go +++ b/staging/src/k8s.io/apimachinery/pkg/runtime/embedded.go @@ -30,6 +30,12 @@ type encodable struct { } func (e encodable) GetObjectKind() schema.ObjectKind { return e.obj.GetObjectKind() } +func (e encodable) DeepCopyObject() Object { + var out encodable = e + out.obj = e.obj.DeepCopyObject() + copy(out.versions, e.versions) + return out +} // NewEncodable creates an object that will be encoded with the provided codec on demand. // Provided as a convenience for test cases dealing with internal objects. diff --git a/staging/src/k8s.io/apimachinery/pkg/runtime/interfaces.go b/staging/src/k8s.io/apimachinery/pkg/runtime/interfaces.go index 281f8d23c7c..db4c2807e67 100644 --- a/staging/src/k8s.io/apimachinery/pkg/runtime/interfaces.go +++ b/staging/src/k8s.io/apimachinery/pkg/runtime/interfaces.go @@ -234,6 +234,7 @@ type SelfLinker interface { // to return a no-op ObjectKindAccessor in cases where it is not expected to be serialized. type Object interface { GetObjectKind() schema.ObjectKind + DeepCopyObject() Object } // Unstructured objects store values as map[string]interface{}, with only values that can be serialized diff --git a/staging/src/k8s.io/apimachinery/pkg/runtime/serializer/json/json_test.go b/staging/src/k8s.io/apimachinery/pkg/runtime/serializer/json/json_test.go index 01df7a46b70..469bf3ed8df 100644 --- a/staging/src/k8s.io/apimachinery/pkg/runtime/serializer/json/json_test.go +++ b/staging/src/k8s.io/apimachinery/pkg/runtime/serializer/json/json_test.go @@ -37,6 +37,9 @@ type testDecodable struct { func (d *testDecodable) GetObjectKind() schema.ObjectKind { return d } func (d *testDecodable) SetGroupVersionKind(gvk schema.GroupVersionKind) { d.gvk = gvk } func (d *testDecodable) GroupVersionKind() schema.GroupVersionKind { return d.gvk } +func (d *testDecodable) DeepCopyObject() runtime.Object { + panic("testDecodable does not support DeepCopy") +} func TestDecode(t *testing.T) { testCases := []struct { diff --git a/staging/src/k8s.io/apimachinery/pkg/runtime/serializer/recognizer/testing/recognizer_test.go b/staging/src/k8s.io/apimachinery/pkg/runtime/serializer/recognizer/testing/recognizer_test.go index 79329f3dfb8..332c2cfbdbf 100644 --- a/staging/src/k8s.io/apimachinery/pkg/runtime/serializer/recognizer/testing/recognizer_test.go +++ b/staging/src/k8s.io/apimachinery/pkg/runtime/serializer/recognizer/testing/recognizer_test.go @@ -28,6 +28,9 @@ import ( type A struct{} func (A) GetObjectKind() schema.ObjectKind { return schema.EmptyObjectKind } +func (a A) DeepCopyObject() runtime.Object { + return a +} func TestRecognizer(t *testing.T) { s := runtime.NewScheme() diff --git a/staging/src/k8s.io/apimachinery/pkg/runtime/serializer/testing/types.go b/staging/src/k8s.io/apimachinery/pkg/runtime/serializer/testing/types.go index f6eb069903c..7693d75a65f 100644 --- a/staging/src/k8s.io/apimachinery/pkg/runtime/serializer/testing/types.go +++ b/staging/src/k8s.io/apimachinery/pkg/runtime/serializer/testing/types.go @@ -30,6 +30,7 @@ type MyWeirdCustomEmbeddedVersionKindField struct { Y uint64 `json:"Y,omitempty"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type TestType1 struct { MyWeirdCustomEmbeddedVersionKindField `json:",inline"` A string `json:"A,omitempty"` @@ -50,16 +51,19 @@ type TestType1 struct { P []TestType2 `json:"Q,omitempty"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type TestType2 struct { A string `json:"A,omitempty"` B int `json:"B,omitempty"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type ExternalTestType2 struct { A string `json:"A,omitempty"` B int `json:"B,omitempty"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type ExternalTestType1 struct { MyWeirdCustomEmbeddedVersionKindField `json:",inline"` A string `json:"A,omitempty"` @@ -80,6 +84,7 @@ type ExternalTestType1 struct { P []ExternalTestType2 `json:"Q,omitempty"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type ExternalInternalSame struct { MyWeirdCustomEmbeddedVersionKindField `json:",inline"` A TestType2 `json:"A,omitempty"` diff --git a/staging/src/k8s.io/apimachinery/pkg/runtime/serializer/versioning/versioning_test.go b/staging/src/k8s.io/apimachinery/pkg/runtime/serializer/versioning/versioning_test.go index 19b4f6d4f36..b0a42fb54bd 100644 --- a/staging/src/k8s.io/apimachinery/pkg/runtime/serializer/versioning/versioning_test.go +++ b/staging/src/k8s.io/apimachinery/pkg/runtime/serializer/versioning/versioning_test.go @@ -37,6 +37,13 @@ type testDecodable struct { func (d *testDecodable) GetObjectKind() schema.ObjectKind { return d } func (d *testDecodable) SetGroupVersionKind(gvk schema.GroupVersionKind) { d.gvk = gvk } func (d *testDecodable) GroupVersionKind() schema.GroupVersionKind { return d.gvk } +func (d *testDecodable) DeepCopyObject() runtime.Object { + if d == nil { + return nil + } + clone := *d + return &clone +} type testNestedDecodable struct { Other string @@ -50,6 +57,13 @@ type testNestedDecodable struct { func (d *testNestedDecodable) GetObjectKind() schema.ObjectKind { return d } func (d *testNestedDecodable) SetGroupVersionKind(gvk schema.GroupVersionKind) { d.gvk = gvk } func (d *testNestedDecodable) GroupVersionKind() schema.GroupVersionKind { return d.gvk } +func (d *testNestedDecodable) DeepCopyObject() runtime.Object { + if d == nil { + return nil + } + clone := *d + return &clone +} func (d *testNestedDecodable) EncodeNestedObjects(e runtime.Encoder) error { d.nestedCalled = true diff --git a/staging/src/k8s.io/apimachinery/pkg/runtime/testing/types.go b/staging/src/k8s.io/apimachinery/pkg/runtime/testing/types.go index aeea7084bea..c051fb1d277 100644 --- a/staging/src/k8s.io/apimachinery/pkg/runtime/testing/types.go +++ b/staging/src/k8s.io/apimachinery/pkg/runtime/testing/types.go @@ -21,6 +21,7 @@ import ( "k8s.io/apimachinery/pkg/runtime/schema" ) +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type EmbeddedTest struct { runtime.TypeMeta ID string @@ -28,6 +29,7 @@ type EmbeddedTest struct { EmptyObject runtime.Object } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type EmbeddedTestExternal struct { runtime.TypeMeta `json:",inline"` ID string `json:"id,omitempty"` @@ -35,6 +37,7 @@ type EmbeddedTestExternal struct { EmptyObject runtime.RawExtension `json:"emptyObject,omitempty"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type ObjectTest struct { runtime.TypeMeta @@ -42,6 +45,7 @@ type ObjectTest struct { Items []runtime.Object } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type ObjectTestExternal struct { runtime.TypeMeta `yaml:",inline" json:",inline"` @@ -49,46 +53,55 @@ type ObjectTestExternal struct { Items []runtime.RawExtension `json:"items,omitempty"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type InternalSimple struct { runtime.TypeMeta `json:",inline"` TestString string `json:"testString"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type ExternalSimple struct { runtime.TypeMeta `json:",inline"` TestString string `json:"testString"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type ExtensionA struct { runtime.TypeMeta `json:",inline"` TestString string `json:"testString"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type ExtensionB struct { runtime.TypeMeta `json:",inline"` TestString string `json:"testString"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type ExternalExtensionType struct { runtime.TypeMeta `json:",inline"` Extension runtime.RawExtension `json:"extension"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type InternalExtensionType struct { runtime.TypeMeta `json:",inline"` Extension runtime.Object `json:"extension"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type ExternalOptionalExtensionType struct { runtime.TypeMeta `json:",inline"` Extension runtime.RawExtension `json:"extension,omitempty"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type InternalOptionalExtensionType struct { runtime.TypeMeta `json:",inline"` Extension runtime.Object `json:"extension,omitempty"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type InternalComplex struct { runtime.TypeMeta String string @@ -98,6 +111,7 @@ type InternalComplex struct { Bool bool } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type ExternalComplex struct { runtime.TypeMeta `json:",inline"` String string `json:"string" description:"testing"` @@ -117,6 +131,7 @@ type MyWeirdCustomEmbeddedVersionKindField struct { Y uint64 `json:"Y,omitempty"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type TestType1 struct { MyWeirdCustomEmbeddedVersionKindField `json:",inline"` A string `json:"A,omitempty"` @@ -137,16 +152,19 @@ type TestType1 struct { P []TestType2 `json:"Q,omitempty"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type TestType2 struct { A string `json:"A,omitempty"` B int `json:"B,omitempty"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type ExternalTestType2 struct { A string `json:"A,omitempty"` B int `json:"B,omitempty"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type ExternalTestType1 struct { MyWeirdCustomEmbeddedVersionKindField `json:",inline"` A string `json:"A,omitempty"` @@ -167,16 +185,19 @@ type ExternalTestType1 struct { P []ExternalTestType2 `json:"Q,omitempty"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type ExternalInternalSame struct { MyWeirdCustomEmbeddedVersionKindField `json:",inline"` A TestType2 `json:"A,omitempty"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type UnversionedType struct { MyWeirdCustomEmbeddedVersionKindField `json:",inline"` A string `json:"A,omitempty"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type UnknownType struct { MyWeirdCustomEmbeddedVersionKindField `json:",inline"` A string `json:"A,omitempty"` diff --git a/staging/src/k8s.io/apimachinery/pkg/runtime/types.go b/staging/src/k8s.io/apimachinery/pkg/runtime/types.go index f972c5e697a..e4515d8ed00 100644 --- a/staging/src/k8s.io/apimachinery/pkg/runtime/types.go +++ b/staging/src/k8s.io/apimachinery/pkg/runtime/types.go @@ -30,7 +30,7 @@ package runtime // TypeMeta is provided here for convenience. You may use it directly from this package or define // your own with the same fields. // -// +k8s:deepcopy-gen=true +// +k8s:deepcopy-gen=false // +protobuf=true // +k8s:openapi-gen=true type TypeMeta struct { @@ -106,6 +106,7 @@ type RawExtension struct { // metadata and field mutatation. // // +k8s:deepcopy-gen=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +protobuf=true // +k8s:openapi-gen=true type Unknown struct { @@ -124,6 +125,9 @@ type Unknown struct { // VersionedObjects is used by Decoders to give callers a way to access all versions // of an object during the decoding process. +// +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:deepcopy-gen=true type VersionedObjects struct { // Objects is the set of objects retrieved during decoding, in order of conversion. // The 0 index is the object as serialized on the wire. If conversion has occurred, diff --git a/staging/src/k8s.io/apimachinery/pkg/test/api_meta_help_test.go b/staging/src/k8s.io/apimachinery/pkg/test/api_meta_help_test.go index 42b6013ae3c..a68da324d67 100644 --- a/staging/src/k8s.io/apimachinery/pkg/test/api_meta_help_test.go +++ b/staging/src/k8s.io/apimachinery/pkg/test/api_meta_help_test.go @@ -207,6 +207,9 @@ type fakePtrInterfaceList struct { func (obj fakePtrInterfaceList) GetObjectKind() schema.ObjectKind { return schema.EmptyObjectKind } +func (obj fakePtrInterfaceList) DeepCopyObject() runtime.Object { + panic("fakePtrInterfaceList does not support DeepCopy") +} func TestExtractListOfInterfacePtrs(t *testing.T) { pl := &fakePtrInterfaceList{ @@ -228,6 +231,18 @@ type fakePtrValueList struct { func (obj fakePtrValueList) GetObjectKind() schema.ObjectKind { return schema.EmptyObjectKind } +func (obj *fakePtrValueList) DeepCopyObject() runtime.Object { + if obj == nil { + return nil + } + clone := fakePtrValueList{ + Items: make([]*testapigroup.Carp, len(obj.Items)), + } + for i, carp := range obj.Items { + clone.Items[i] = carp.DeepCopy() + } + return &clone +} func TestSetList(t *testing.T) { pl := &testapigroup.CarpList{} diff --git a/staging/src/k8s.io/apimachinery/pkg/test/api_meta_meta_test.go b/staging/src/k8s.io/apimachinery/pkg/test/api_meta_meta_test.go index 18a99e46f20..575687edd4a 100644 --- a/staging/src/k8s.io/apimachinery/pkg/test/api_meta_meta_test.go +++ b/staging/src/k8s.io/apimachinery/pkg/test/api_meta_meta_test.go @@ -224,12 +224,18 @@ func (obj *MyAPIObject) SetGroupVersionKind(gvk schema.GroupVersionKind) { func (obj *MyAPIObject) GroupVersionKind() schema.GroupVersionKind { return schema.FromAPIVersionAndKind(obj.TypeMeta.APIVersion, obj.TypeMeta.Kind) } +func (obj *MyAPIObject) DeepCopyObject() runtime.Object { + panic("MyAPIObject does not support DeepCopy") +} type MyIncorrectlyMarkedAsAPIObject struct{} func (obj *MyIncorrectlyMarkedAsAPIObject) GetObjectKind() schema.ObjectKind { return schema.EmptyObjectKind } +func (obj *MyIncorrectlyMarkedAsAPIObject) DeepCopyObject() runtime.Object { + panic("MyIncorrectlyMarkedAsAPIObject does not support DeepCopy") +} func TestResourceVersionerOfAPI(t *testing.T) { type T struct { diff --git a/staging/src/k8s.io/apimachinery/pkg/test/runtime_serializer_protobuf_protobuf_test.go b/staging/src/k8s.io/apimachinery/pkg/test/runtime_serializer_protobuf_protobuf_test.go index 818d243a720..fb305d1756e 100644 --- a/staging/src/k8s.io/apimachinery/pkg/test/runtime_serializer_protobuf_protobuf_test.go +++ b/staging/src/k8s.io/apimachinery/pkg/test/runtime_serializer_protobuf_protobuf_test.go @@ -40,6 +40,9 @@ type testObject struct { func (d *testObject) GetObjectKind() schema.ObjectKind { return d } func (d *testObject) SetGroupVersionKind(gvk schema.GroupVersionKind) { d.gvk = gvk } func (d *testObject) GroupVersionKind() schema.GroupVersionKind { return d.gvk } +func (d *testObject) DeepCopyObject() runtime.Object { + panic("testObject does not support DeepCopy") +} type testMarshalable struct { testObject @@ -51,6 +54,10 @@ func (d *testMarshalable) Marshal() ([]byte, error) { return d.data, d.err } +func (d *testMarshalable) DeepCopyObject() runtime.Object { + panic("testMarshalable does not support DeepCopy") +} + type testBufferedMarshalable struct { testObject data []byte @@ -70,6 +77,10 @@ func (d *testBufferedMarshalable) Size() int { return len(d.data) } +func (d *testBufferedMarshalable) DeepCopyObject() runtime.Object { + panic("testBufferedMarshalable does not support DeepCopy") +} + func TestRecognize(t *testing.T) { s := protobuf.NewSerializer(nil, nil, "application/protobuf") ignores := [][]byte{ diff --git a/staging/src/k8s.io/apimachinery/pkg/test/util.go b/staging/src/k8s.io/apimachinery/pkg/test/util.go index 721eff4ad16..4ed5674d426 100644 --- a/staging/src/k8s.io/apimachinery/pkg/test/util.go +++ b/staging/src/k8s.io/apimachinery/pkg/test/util.go @@ -27,6 +27,9 @@ import ( // List and ListV1 should be kept in sync with k8s.io/kubernetes/pkg/api#List // and k8s.io/api/core/v1#List. +// +// +k8s:deepcopy-gen=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type List struct { metav1.TypeMeta metav1.ListMeta @@ -34,6 +37,8 @@ type List struct { Items []runtime.Object } +// +k8s:deepcopy-gen=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type ListV1 struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` diff --git a/staging/src/k8s.io/apimachinery/pkg/watch/mux.go b/staging/src/k8s.io/apimachinery/pkg/watch/mux.go index fafccd78ef3..a65088c1cf8 100644 --- a/staging/src/k8s.io/apimachinery/pkg/watch/mux.go +++ b/staging/src/k8s.io/apimachinery/pkg/watch/mux.go @@ -84,6 +84,13 @@ type functionFakeRuntimeObject func() func (obj functionFakeRuntimeObject) GetObjectKind() schema.ObjectKind { return schema.EmptyObjectKind } +func (obj functionFakeRuntimeObject) DeepCopyObject() runtime.Object { + if obj == nil { + return nil + } + // funcs are immutable. Hence, just return the original func. + return obj +} // Execute f, blocking the incoming queue (and waiting for it to drain first). // The purpose of this terrible hack is so that watchers added after an event diff --git a/staging/src/k8s.io/apimachinery/pkg/watch/mux_test.go b/staging/src/k8s.io/apimachinery/pkg/watch/mux_test.go index d2b17fad42b..7029cf1f4bf 100644 --- a/staging/src/k8s.io/apimachinery/pkg/watch/mux_test.go +++ b/staging/src/k8s.io/apimachinery/pkg/watch/mux_test.go @@ -22,6 +22,7 @@ import ( "testing" "time" + "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/util/wait" . "k8s.io/apimachinery/pkg/watch" @@ -33,6 +34,13 @@ type myType struct { } func (obj *myType) GetObjectKind() schema.ObjectKind { return schema.EmptyObjectKind } +func (obj *myType) DeepCopyObject() runtime.Object { + if obj == nil { + return nil + } + clone := *obj + return &clone +} func TestBroadcaster(t *testing.T) { table := []Event{ diff --git a/staging/src/k8s.io/apimachinery/pkg/watch/until_test.go b/staging/src/k8s.io/apimachinery/pkg/watch/until_test.go index fdcb6a1573c..e872c36813a 100644 --- a/staging/src/k8s.io/apimachinery/pkg/watch/until_test.go +++ b/staging/src/k8s.io/apimachinery/pkg/watch/until_test.go @@ -22,6 +22,7 @@ import ( "testing" "time" + "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/util/wait" ) @@ -31,6 +32,7 @@ type fakePod struct { } func (obj *fakePod) GetObjectKind() schema.ObjectKind { return schema.EmptyObjectKind } +func (obj *fakePod) DeepCopyObject() runtime.Object { panic("DeepCopyObject not supported by fakePod") } func TestUntil(t *testing.T) { fw := NewFake() diff --git a/staging/src/k8s.io/apimachinery/pkg/watch/watch.go b/staging/src/k8s.io/apimachinery/pkg/watch/watch.go index dd49c41f9ac..5c1380b2349 100644 --- a/staging/src/k8s.io/apimachinery/pkg/watch/watch.go +++ b/staging/src/k8s.io/apimachinery/pkg/watch/watch.go @@ -20,9 +20,9 @@ import ( "fmt" "sync" - "k8s.io/apimachinery/pkg/runtime" - "github.com/golang/glog" + + "k8s.io/apimachinery/pkg/runtime" ) // Interface can be implemented by anything that knows how to watch and report changes. @@ -50,6 +50,7 @@ const ( ) // Event represents a single event to a watched resource. +// +k8s:deepcopy-gen=true type Event struct { Type EventType diff --git a/staging/src/k8s.io/apimachinery/pkg/watch/watch_test.go b/staging/src/k8s.io/apimachinery/pkg/watch/watch_test.go index 42d39704ba9..bdf7fedd4af 100644 --- a/staging/src/k8s.io/apimachinery/pkg/watch/watch_test.go +++ b/staging/src/k8s.io/apimachinery/pkg/watch/watch_test.go @@ -19,6 +19,7 @@ package watch_test import ( "testing" + "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" . "k8s.io/apimachinery/pkg/watch" ) @@ -26,6 +27,7 @@ import ( type testType string func (obj testType) GetObjectKind() schema.ObjectKind { return schema.EmptyObjectKind } +func (obj testType) DeepCopyObject() runtime.Object { return obj } func TestFake(t *testing.T) { f := NewFake() diff --git a/staging/src/k8s.io/apiserver/pkg/apis/apiserver/types.go b/staging/src/k8s.io/apiserver/pkg/apis/apiserver/types.go index 0af031e9223..f84fd04a340 100644 --- a/staging/src/k8s.io/apiserver/pkg/apis/apiserver/types.go +++ b/staging/src/k8s.io/apiserver/pkg/apis/apiserver/types.go @@ -21,6 +21,8 @@ import ( "k8s.io/apimachinery/pkg/runtime" ) +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // AdmissionConfiguration provides versioned configuration for admission controllers. type AdmissionConfiguration struct { metav1.TypeMeta diff --git a/staging/src/k8s.io/apiserver/pkg/apis/apiserver/v1alpha1/types.go b/staging/src/k8s.io/apiserver/pkg/apis/apiserver/v1alpha1/types.go index bf0ce843a8d..522c41c4143 100644 --- a/staging/src/k8s.io/apiserver/pkg/apis/apiserver/v1alpha1/types.go +++ b/staging/src/k8s.io/apiserver/pkg/apis/apiserver/v1alpha1/types.go @@ -21,6 +21,8 @@ import ( "k8s.io/apimachinery/pkg/runtime" ) +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // AdmissionConfiguration provides versioned configuration for admission controllers. type AdmissionConfiguration struct { metav1.TypeMeta `json:",inline"` diff --git a/staging/src/k8s.io/apiserver/pkg/apis/audit/types.go b/staging/src/k8s.io/apiserver/pkg/apis/audit/types.go index 8e8770d0084..0cb2069259a 100644 --- a/staging/src/k8s.io/apiserver/pkg/apis/audit/types.go +++ b/staging/src/k8s.io/apiserver/pkg/apis/audit/types.go @@ -65,6 +65,8 @@ const ( StagePanic = "Panic" ) +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // Event captures all the information that can be included in an API audit log. type Event struct { metav1.TypeMeta @@ -118,6 +120,8 @@ type Event struct { ResponseObject *runtime.Unknown } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // EventList is a list of audit Events. type EventList struct { metav1.TypeMeta @@ -127,6 +131,8 @@ type EventList struct { Items []Event } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // Policy defines the configuration of audit logging, and the rules for how different request // categories are logged. type Policy struct { @@ -142,6 +148,8 @@ type Policy struct { Rules []PolicyRule } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // PolicyList is a list of audit Policies. type PolicyList struct { metav1.TypeMeta diff --git a/staging/src/k8s.io/apiserver/pkg/apis/audit/v1alpha1/types.go b/staging/src/k8s.io/apiserver/pkg/apis/audit/v1alpha1/types.go index a450b35dfa0..d64f6a8d49c 100644 --- a/staging/src/k8s.io/apiserver/pkg/apis/audit/v1alpha1/types.go +++ b/staging/src/k8s.io/apiserver/pkg/apis/audit/v1alpha1/types.go @@ -66,6 +66,8 @@ const ( StagePanic = "Panic" ) +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // Event captures all the information that can be included in an API audit log. type Event struct { metav1.TypeMeta `json:",inline"` @@ -119,6 +121,8 @@ type Event struct { ResponseObject *runtime.Unknown `json:"responseObject,omitempty" protobuf:"bytes,14,opt,name=responseObject"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // EventList is a list of audit Events. type EventList struct { metav1.TypeMeta `json:",inline"` @@ -128,6 +132,8 @@ type EventList struct { Items []Event `json:"items" protobuf:"bytes,2,rep,name=items"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // Policy defines the configuration of audit logging, and the rules for how different request // categories are logged. type Policy struct { @@ -143,6 +149,8 @@ type Policy struct { Rules []PolicyRule `json:"rules" protobuf:"bytes,2,rep,name=rules"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // PolicyList is a list of audit Policies. type PolicyList struct { metav1.TypeMeta `json:",inline"` diff --git a/staging/src/k8s.io/apiserver/pkg/apis/example/types.go b/staging/src/k8s.io/apiserver/pkg/apis/example/types.go index 340c0abebee..6dd3e217242 100644 --- a/staging/src/k8s.io/apiserver/pkg/apis/example/types.go +++ b/staging/src/k8s.io/apiserver/pkg/apis/example/types.go @@ -27,6 +27,8 @@ type ( RestartPolicy string ) +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // Pod is a collection of containers, used as either input (create, update) or as output (list, get). type Pod struct { metav1.TypeMeta @@ -124,6 +126,8 @@ type PodSpec struct { SchedulerName string } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // PodList is a list of Pods. type PodList struct { metav1.TypeMeta diff --git a/staging/src/k8s.io/apiserver/pkg/apis/example/v1/types.go b/staging/src/k8s.io/apiserver/pkg/apis/example/v1/types.go index 7154056ff07..7be2a0c6ff4 100644 --- a/staging/src/k8s.io/apiserver/pkg/apis/example/v1/types.go +++ b/staging/src/k8s.io/apiserver/pkg/apis/example/v1/types.go @@ -27,6 +27,8 @@ type ( RestartPolicy string ) +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // Pod is a collection of containers, used as either input (create, update) or as output (list, get). type Pod struct { metav1.TypeMeta `json:",inline"` @@ -178,6 +180,8 @@ type PodSpec struct { SchedulerName string `json:"schedulername,omitempty" protobuf:"bytes,19,opt,name=schedulername"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // PodList is a list of Pods. type PodList struct { metav1.TypeMeta `json:",inline"` diff --git a/staging/src/k8s.io/apiserver/pkg/endpoints/apiserver_test.go b/staging/src/k8s.io/apiserver/pkg/endpoints/apiserver_test.go index b17ba47910d..14f87fa8249 100644 --- a/staging/src/k8s.io/apiserver/pkg/endpoints/apiserver_test.go +++ b/staging/src/k8s.io/apiserver/pkg/endpoints/apiserver_test.go @@ -467,6 +467,9 @@ func (s *SimpleStream) Close() error { } func (obj *SimpleStream) GetObjectKind() schema.ObjectKind { return schema.EmptyObjectKind } +func (obj *SimpleStream) DeepCopyObject() runtime.Object { + panic("SimpleStream does not support DeepCopy") +} func (s *SimpleStream) InputStream(version, accept string) (io.ReadCloser, bool, string, error) { s.version = version @@ -3761,6 +3764,13 @@ type UnregisteredAPIObject struct { func (obj *UnregisteredAPIObject) GetObjectKind() schema.ObjectKind { return schema.EmptyObjectKind } +func (obj *UnregisteredAPIObject) DeepCopyObject() runtime.Object { + if obj == nil { + return nil + } + clone := *obj + return &clone +} func TestWriteJSONDecodeError(t *testing.T) { server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { diff --git a/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/rest_test.go b/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/rest_test.go index 5b5cc60a764..931de27f9e1 100644 --- a/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/rest_test.go +++ b/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/rest_test.go @@ -64,6 +64,14 @@ type TestPatchSubType struct { StringField string `json:"theField"` } +func (obj *testPatchType) DeepCopyObject() runtime.Object { + if obj == nil { + return nil + } + clone := *obj + return &clone +} + func TestPatchAnonymousField(t *testing.T) { testGV := schema.GroupVersion{Group: "", Version: "v"} scheme.AddKnownTypes(testGV, &testPatchType{}) diff --git a/staging/src/k8s.io/apiserver/pkg/endpoints/openapi/testing/types.go b/staging/src/k8s.io/apiserver/pkg/endpoints/openapi/testing/types.go index 9b408f5f931..14a86419c20 100644 --- a/staging/src/k8s.io/apiserver/pkg/endpoints/openapi/testing/types.go +++ b/staging/src/k8s.io/apiserver/pkg/endpoints/openapi/testing/types.go @@ -21,6 +21,7 @@ import ( ) // +k8s:deepcopy-gen=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type TestType struct { } diff --git a/staging/src/k8s.io/apiserver/pkg/endpoints/testing/types.go b/staging/src/k8s.io/apiserver/pkg/endpoints/testing/types.go index b197bb51e53..0cfaacf3151 100644 --- a/staging/src/k8s.io/apiserver/pkg/endpoints/testing/types.go +++ b/staging/src/k8s.io/apiserver/pkg/endpoints/testing/types.go @@ -20,6 +20,8 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + type Simple struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata"` @@ -29,6 +31,8 @@ type Simple struct { Labels map[string]string `json:"labels,omitempty"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + type SimpleRoot struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata"` @@ -38,6 +42,8 @@ type SimpleRoot struct { Labels map[string]string `json:"labels,omitempty"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + type SimpleGetOptions struct { metav1.TypeMeta `json:",inline"` Param1 string `json:"param1"` @@ -52,6 +58,8 @@ func (SimpleGetOptions) SwaggerDoc() map[string]string { } } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + type SimpleList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,inline"` @@ -59,6 +67,8 @@ type SimpleList struct { Items []Simple `json:"items,omitempty"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // SimpleXGSubresource is a cross group subresource, i.e. the subresource does not belong to the // same group as its parent resource. type SimpleXGSubresource struct { diff --git a/staging/src/k8s.io/apiserver/pkg/registry/generic/rest/streamer.go b/staging/src/k8s.io/apiserver/pkg/registry/generic/rest/streamer.go index 25477bd910d..d84a01ab6c5 100644 --- a/staging/src/k8s.io/apiserver/pkg/registry/generic/rest/streamer.go +++ b/staging/src/k8s.io/apiserver/pkg/registry/generic/rest/streamer.go @@ -22,6 +22,7 @@ import ( "net/url" "strings" + "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apiserver/pkg/registry/rest" ) @@ -42,6 +43,9 @@ var _ rest.ResourceStreamer = &LocationStreamer{} func (obj *LocationStreamer) GetObjectKind() schema.ObjectKind { return schema.EmptyObjectKind } +func (obj *LocationStreamer) DeepCopyObject() runtime.Object { + panic("rest.LocationStreamer does not implement DeepCopyObject") +} // InputStream returns a stream with the contents of the URL location. If no location is provided, // a null stream is returned. diff --git a/staging/src/k8s.io/apiserver/pkg/registry/rest/rest.go b/staging/src/k8s.io/apiserver/pkg/registry/rest/rest.go index 07871c5bb38..e7e9259a9aa 100644 --- a/staging/src/k8s.io/apiserver/pkg/registry/rest/rest.go +++ b/staging/src/k8s.io/apiserver/pkg/registry/rest/rest.go @@ -319,6 +319,8 @@ type StorageMetadata interface { ProducesObject(verb string) interface{} } +// +k8s:deepcopy-gen=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // ConnectRequest is an object passed to admission control for Connect operations type ConnectRequest struct { // Name is the name of the object on which the connect request was made diff --git a/staging/src/k8s.io/apiserver/pkg/storage/selection_predicate_test.go b/staging/src/k8s.io/apiserver/pkg/storage/selection_predicate_test.go index 3c5da649a63..8f6bcf7f890 100644 --- a/staging/src/k8s.io/apiserver/pkg/storage/selection_predicate_test.go +++ b/staging/src/k8s.io/apiserver/pkg/storage/selection_predicate_test.go @@ -36,6 +36,12 @@ type IgnoredList struct { func (obj *Ignored) GetObjectKind() schema.ObjectKind { return schema.EmptyObjectKind } func (obj *IgnoredList) GetObjectKind() schema.ObjectKind { return schema.EmptyObjectKind } +func (obj *Ignored) DeepCopyObject() runtime.Object { + panic("Ignored does not support DeepCopy") +} +func (obj *IgnoredList) DeepCopyObject() runtime.Object { + panic("IgnoredList does not support DeepCopy") +} func TestSelectionPredicate(t *testing.T) { table := map[string]struct { diff --git a/staging/src/k8s.io/apiserver/pkg/storage/testing/types.go b/staging/src/k8s.io/apiserver/pkg/storage/testing/types.go index 6aaa1df26bc..37a70cbf5f7 100644 --- a/staging/src/k8s.io/apiserver/pkg/storage/testing/types.go +++ b/staging/src/k8s.io/apiserver/pkg/storage/testing/types.go @@ -20,6 +20,8 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + type TestResource struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata"` diff --git a/staging/src/k8s.io/client-go/rest/config.go b/staging/src/k8s.io/client-go/rest/config.go index b7ff6880940..dca7333dd00 100644 --- a/staging/src/k8s.io/client-go/rest/config.go +++ b/staging/src/k8s.io/client-go/rest/config.go @@ -126,6 +126,7 @@ type ImpersonationConfig struct { Extra map[string][]string } +// +k8s:deepcopy-gen=true // TLSClientConfig contains settings to enable transport layer security type TLSClientConfig struct { // Server should be accessed without verifying the TLS certificate. For testing only. diff --git a/staging/src/k8s.io/client-go/tools/clientcmd/api/doc.go b/staging/src/k8s.io/client-go/tools/clientcmd/api/doc.go new file mode 100644 index 00000000000..93a891e9543 --- /dev/null +++ b/staging/src/k8s.io/client-go/tools/clientcmd/api/doc.go @@ -0,0 +1,18 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// +k8s:deepcopy-gen=package,register +package api diff --git a/staging/src/k8s.io/client-go/tools/clientcmd/api/types.go b/staging/src/k8s.io/client-go/tools/clientcmd/api/types.go index 76090c6f56d..407dec83a4f 100644 --- a/staging/src/k8s.io/client-go/tools/clientcmd/api/types.go +++ b/staging/src/k8s.io/client-go/tools/clientcmd/api/types.go @@ -25,6 +25,7 @@ import ( // Config holds the information needed to build connect to remote kubernetes clusters as a given user // IMPORTANT if you add fields to this struct, please update IsConfigEmpty() +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type Config struct { // Legacy field from pkg/api/types.go TypeMeta. // TODO(jlowdermilk): remove this after eliminating downstream dependencies. diff --git a/staging/src/k8s.io/client-go/tools/clientcmd/api/v1/doc.go b/staging/src/k8s.io/client-go/tools/clientcmd/api/v1/doc.go new file mode 100644 index 00000000000..c8ede58a342 --- /dev/null +++ b/staging/src/k8s.io/client-go/tools/clientcmd/api/v1/doc.go @@ -0,0 +1,18 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// +k8s:deepcopy-gen=package,register +package v1 diff --git a/staging/src/k8s.io/client-go/tools/clientcmd/api/v1/types.go b/staging/src/k8s.io/client-go/tools/clientcmd/api/v1/types.go index 21b94d25fdc..53568135e8f 100644 --- a/staging/src/k8s.io/client-go/tools/clientcmd/api/v1/types.go +++ b/staging/src/k8s.io/client-go/tools/clientcmd/api/v1/types.go @@ -24,6 +24,7 @@ import ( // Top level config objects and all values required for proper functioning are not "omitempty". Any truly optional piece of config is allowed to be omitted. // Config holds the information needed to build connect to remote kubernetes clusters as a given user +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type Config struct { // Legacy field from pkg/api/types.go TypeMeta. // TODO(jlowdermilk): remove this after eliminating downstream dependencies. diff --git a/staging/src/k8s.io/kube-aggregator/pkg/apis/apiregistration/types.go b/staging/src/k8s.io/kube-aggregator/pkg/apis/apiregistration/types.go index 2ab58332e45..e72ef47b91a 100644 --- a/staging/src/k8s.io/kube-aggregator/pkg/apis/apiregistration/types.go +++ b/staging/src/k8s.io/kube-aggregator/pkg/apis/apiregistration/types.go @@ -18,6 +18,8 @@ package apiregistration import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // APIServiceList is a list of APIService objects. type APIServiceList struct { metav1.TypeMeta @@ -111,6 +113,7 @@ type APIServiceStatus struct { // +genclient=true // +nonNamespaced=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // APIService represents a server for a particular GroupVersion. // Name must be "version.group". diff --git a/staging/src/k8s.io/kube-aggregator/pkg/apis/apiregistration/v1beta1/types.go b/staging/src/k8s.io/kube-aggregator/pkg/apis/apiregistration/v1beta1/types.go index 095758cfb0b..0aeef6e216c 100644 --- a/staging/src/k8s.io/kube-aggregator/pkg/apis/apiregistration/v1beta1/types.go +++ b/staging/src/k8s.io/kube-aggregator/pkg/apis/apiregistration/v1beta1/types.go @@ -18,6 +18,8 @@ package v1beta1 import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // APIServiceList is a list of APIService objects. type APIServiceList struct { metav1.TypeMeta `json:",inline"` @@ -119,6 +121,7 @@ type APIServiceStatus struct { // +genclient=true // +nonNamespaced=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // APIService represents a server for a particular GroupVersion. // Name must be "version.group". diff --git a/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/types.go b/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/types.go index b05fac39832..067cadc9856 100644 --- a/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/types.go +++ b/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/types.go @@ -22,6 +22,8 @@ import ( "k8s.io/apimachinery/pkg/types" ) +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // a list of values for a given metric for some set of objects type MetricValueList struct { metav1.TypeMeta `json:",inline"` @@ -31,6 +33,8 @@ type MetricValueList struct { Items []MetricValue `json:"items"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // a metric value for some object type MetricValue struct { metav1.TypeMeta `json:",inline"` diff --git a/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1alpha1/types.go b/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1alpha1/types.go index 1e80ae16820..3f06a8202e5 100644 --- a/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1alpha1/types.go +++ b/staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1alpha1/types.go @@ -22,6 +22,8 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // a list of values for a given metric for some set of objects type MetricValueList struct { metav1.TypeMeta `json:",inline"` @@ -31,6 +33,8 @@ type MetricValueList struct { Items []MetricValue `json:"items" protobuf:"bytes,2,rep,name=items"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // a metric value for some object type MetricValue struct { metav1.TypeMeta `json:",inline"` diff --git a/staging/src/k8s.io/metrics/pkg/apis/metrics/types.go b/staging/src/k8s.io/metrics/pkg/apis/metrics/types.go index 4d4efbbdc74..6002aada3f1 100644 --- a/staging/src/k8s.io/metrics/pkg/apis/metrics/types.go +++ b/staging/src/k8s.io/metrics/pkg/apis/metrics/types.go @@ -25,6 +25,7 @@ import ( // +resourceName=nodes // +readonly=true // +nonNamespaced=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // resource usage metrics of a node. type NodeMetrics struct { @@ -40,6 +41,8 @@ type NodeMetrics struct { Usage ResourceList } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // NodeMetricsList is a list of NodeMetrics. type NodeMetricsList struct { metav1.TypeMeta @@ -54,6 +57,7 @@ type NodeMetricsList struct { // +genclient=true // +resourceName=pods // +readonly=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // resource usage metrics of a pod. type PodMetrics struct { @@ -69,6 +73,8 @@ type PodMetrics struct { Containers []ContainerMetrics } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // PodMetricsList is a list of PodMetrics. type PodMetricsList struct { metav1.TypeMeta diff --git a/staging/src/k8s.io/metrics/pkg/apis/metrics/v1alpha1/types.go b/staging/src/k8s.io/metrics/pkg/apis/metrics/v1alpha1/types.go index c3c567366b2..e2cb2d3ae1a 100644 --- a/staging/src/k8s.io/metrics/pkg/apis/metrics/v1alpha1/types.go +++ b/staging/src/k8s.io/metrics/pkg/apis/metrics/v1alpha1/types.go @@ -25,6 +25,7 @@ import ( // +resourceName=nodes // +readonly=true // +nonNamespaced=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // resource usage metrics of a node. type NodeMetrics struct { @@ -40,6 +41,8 @@ type NodeMetrics struct { Usage v1.ResourceList `json:"usage" protobuf:"bytes,4,rep,name=usage,casttype=k8s.io/api/core/v1.ResourceList,castkey=k8s.io/api/core/v1.ResourceName,castvalue=k8s.io/apimachinery/pkg/api/resource.Quantity"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // NodeMetricsList is a list of NodeMetrics. type NodeMetricsList struct { metav1.TypeMeta `json:",inline"` @@ -54,6 +57,7 @@ type NodeMetricsList struct { // +genclient=true // +resourceName=pods // +readonly=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // resource usage metrics of a pod. type PodMetrics struct { @@ -69,6 +73,8 @@ type PodMetrics struct { Containers []ContainerMetrics `json:"containers" protobuf:"bytes,4,rep,name=containers"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // PodMetricsList is a list of PodMetrics. type PodMetricsList struct { metav1.TypeMeta `json:",inline"` diff --git a/staging/src/k8s.io/sample-apiserver/pkg/apis/wardle/types.go b/staging/src/k8s.io/sample-apiserver/pkg/apis/wardle/types.go index cd570f75a11..7a6ba05c09d 100644 --- a/staging/src/k8s.io/sample-apiserver/pkg/apis/wardle/types.go +++ b/staging/src/k8s.io/sample-apiserver/pkg/apis/wardle/types.go @@ -18,6 +18,8 @@ package wardle import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // FlunderList is a list of Flunder objects. type FlunderList struct { metav1.TypeMeta @@ -33,6 +35,7 @@ type FlunderStatus struct { } // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type Flunder struct { metav1.TypeMeta @@ -44,6 +47,7 @@ type Flunder struct { // +genclient=true // +nonNamespaced=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type Fischer struct { metav1.TypeMeta @@ -54,6 +58,7 @@ type Fischer struct { } // +nonNamespaced=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // FischerList is a list of Fischer objects. type FischerList struct { diff --git a/staging/src/k8s.io/sample-apiserver/pkg/apis/wardle/v1alpha1/types.go b/staging/src/k8s.io/sample-apiserver/pkg/apis/wardle/v1alpha1/types.go index 6d9a71f37ae..7f8b2031758 100644 --- a/staging/src/k8s.io/sample-apiserver/pkg/apis/wardle/v1alpha1/types.go +++ b/staging/src/k8s.io/sample-apiserver/pkg/apis/wardle/v1alpha1/types.go @@ -18,6 +18,8 @@ package v1alpha1 import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // FlunderList is a list of Flunder objects. type FlunderList struct { metav1.TypeMeta `json:",inline"` @@ -33,6 +35,7 @@ type FlunderStatus struct { } // +genclient=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type Flunder struct { metav1.TypeMeta `json:",inline"` @@ -44,6 +47,7 @@ type Flunder struct { // +genclient=true // +nonNamespaced=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type Fischer struct { metav1.TypeMeta `json:",inline"` @@ -54,6 +58,7 @@ type Fischer struct { } // +nonNamespaced=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // FischerList is a list of Fischer objects. type FischerList struct {