mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 23:47:50 +00:00
Merge pull request #28679 from sttts/sttts-deepcopy-pointer-in
Automatic merge from submit-queue
Deepcopy: avoid struct copies and reflection Call
- make signature of generated deepcopy methods symmetric with `in *type, out *type`, avoiding copies of big structs on the stack
- switch to `in interface{}, out interface{}` which allows us to call them with without `reflect.Call`
The first change reduces runtime of BenchmarkPodCopy-4 from `> 3500ns` to around `2300ns`.
The second change reduces runtime to around `1900ns`.
This commit is contained in:
@@ -38,15 +38,7 @@ func BenchmarkPodConversion(b *testing.B) {
|
||||
}
|
||||
|
||||
// add a fixed item
|
||||
data, err := ioutil.ReadFile("pod_example.json")
|
||||
if err != nil {
|
||||
b.Fatalf("Unexpected error while reading file: %v", err)
|
||||
}
|
||||
var pod api.Pod
|
||||
if err := runtime.DecodeInto(testapi.Default.Codec(), data, &pod); err != nil {
|
||||
b.Fatalf("Unexpected error decoding pod: %v", err)
|
||||
}
|
||||
items = append(items, pod)
|
||||
items = append(items, benchmarkPod)
|
||||
width := len(items)
|
||||
|
||||
scheme := api.Scheme
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -19,32 +19,129 @@ package api_test
|
||||
import (
|
||||
"io/ioutil"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/testapi"
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
"k8s.io/kubernetes/pkg/types"
|
||||
)
|
||||
|
||||
func BenchmarkPodCopy(b *testing.B) {
|
||||
data, err := ioutil.ReadFile("pod_example.json")
|
||||
func parseTimeOrDie(ts string) unversioned.Time {
|
||||
t, err := time.Parse(time.RFC3339, ts)
|
||||
if err != nil {
|
||||
b.Fatalf("Unexpected error while reading file: %v", err)
|
||||
}
|
||||
var pod api.Pod
|
||||
if err := runtime.DecodeInto(testapi.Default.Codec(), data, &pod); err != nil {
|
||||
b.Fatalf("Unexpected error decoding pod: %v", err)
|
||||
panic(err)
|
||||
}
|
||||
return unversioned.Time{Time: t}
|
||||
}
|
||||
|
||||
var benchmarkPod api.Pod = api.Pod{
|
||||
TypeMeta: unversioned.TypeMeta{
|
||||
Kind: "Pod",
|
||||
APIVersion: "v1",
|
||||
},
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
Name: "etcd-server-e2e-test-wojtekt-master",
|
||||
Namespace: "default",
|
||||
SelfLink: "/api/v1/namespaces/default/pods/etcd-server-e2e-test-wojtekt-master",
|
||||
UID: types.UID("a671734a-e8e5-11e4-8fde-42010af09327"),
|
||||
ResourceVersion: "22",
|
||||
CreationTimestamp: parseTimeOrDie("2015-04-22T11:49:36Z"),
|
||||
Annotations: map[string]string{
|
||||
"kubernetes.io/config.mirror": "mirror",
|
||||
"kubernetes.io/config.source": "file",
|
||||
},
|
||||
},
|
||||
Spec: api.PodSpec{
|
||||
Volumes: []api.Volume{
|
||||
{
|
||||
Name: "varetcd",
|
||||
VolumeSource: api.VolumeSource{
|
||||
HostPath: &api.HostPathVolumeSource{
|
||||
Path: "/mnt/master-pd/var/etcd",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
Containers: []api.Container{
|
||||
{
|
||||
Name: "etcd-container",
|
||||
Image: "gcr.io/google_containers/etcd:2.0.9",
|
||||
Command: []string{
|
||||
"/usr/local/bin/etcd",
|
||||
"--addr",
|
||||
"127.0.0.1:4001",
|
||||
"--bind-addr",
|
||||
"127.0.0.1:4001",
|
||||
"--data-dir",
|
||||
"/var/etcd/data",
|
||||
},
|
||||
Ports: []api.ContainerPort{
|
||||
{
|
||||
Name: "serverport",
|
||||
HostPort: 2380,
|
||||
ContainerPort: 2380,
|
||||
Protocol: "TCP",
|
||||
},
|
||||
{
|
||||
Name: "clientport",
|
||||
HostPort: 4001,
|
||||
ContainerPort: 4001,
|
||||
Protocol: "TCP",
|
||||
},
|
||||
},
|
||||
VolumeMounts: []api.VolumeMount{
|
||||
{
|
||||
Name: "varetcd",
|
||||
MountPath: "/var/etcd",
|
||||
},
|
||||
},
|
||||
TerminationMessagePath: "/dev/termination-log",
|
||||
ImagePullPolicy: api.PullIfNotPresent,
|
||||
},
|
||||
},
|
||||
RestartPolicy: api.RestartPolicyAlways,
|
||||
DNSPolicy: api.DNSClusterFirst,
|
||||
NodeName: "e2e-test-wojtekt-master",
|
||||
},
|
||||
Status: api.PodStatus{
|
||||
Phase: api.PodRunning,
|
||||
Conditions: []api.PodCondition{
|
||||
{
|
||||
Type: api.PodReady,
|
||||
Status: api.ConditionTrue,
|
||||
},
|
||||
},
|
||||
ContainerStatuses: []api.ContainerStatus{
|
||||
{
|
||||
Name: "etcd-container",
|
||||
State: api.ContainerState{
|
||||
Running: &api.ContainerStateRunning{
|
||||
StartedAt: parseTimeOrDie("2015-04-22T11:49:32Z"),
|
||||
},
|
||||
},
|
||||
Ready: true,
|
||||
RestartCount: 0,
|
||||
Image: "gcr.io/google_containers/etcd:2.0.9",
|
||||
ImageID: "docker://b6b9a86dc06aa1361357ca1b105feba961f6a4145adca6c54e142c0be0fe87b0",
|
||||
ContainerID: "docker://3cbbf818f1addfc252957b4504f56ef2907a313fe6afc47fc75373674255d46d",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
func BenchmarkPodCopy(b *testing.B) {
|
||||
var result *api.Pod
|
||||
for i := 0; i < b.N; i++ {
|
||||
obj, err := api.Scheme.DeepCopy(&pod)
|
||||
obj, err := api.Scheme.DeepCopy(&benchmarkPod)
|
||||
if err != nil {
|
||||
b.Fatalf("Unexpected error copying pod: %v", err)
|
||||
}
|
||||
result = obj.(*api.Pod)
|
||||
}
|
||||
if !api.Semantic.DeepEqual(pod, *result) {
|
||||
b.Fatalf("Incorrect copy: expected %v, got %v", pod, *result)
|
||||
if !api.Semantic.DeepEqual(benchmarkPod, *result) {
|
||||
b.Fatalf("Incorrect copy: expected %v, got %v", benchmarkPod, *result)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,102 +0,0 @@
|
||||
{
|
||||
"kind": "Pod",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "etcd-server-e2e-test-wojtekt-master",
|
||||
"namespace": "default",
|
||||
"selfLink": "/api/v1/namespaces/default/pods/etcd-server-e2e-test-wojtekt-master",
|
||||
"uid": "a671734a-e8e5-11e4-8fde-42010af09327",
|
||||
"resourceVersion": "22",
|
||||
"creationTimestamp": "2015-04-22T11:49:36Z",
|
||||
"annotations": {
|
||||
"kubernetes.io/config.mirror": "mirror",
|
||||
"kubernetes.io/config.source": "file"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"volumes": [
|
||||
{
|
||||
"name": "varetcd",
|
||||
"hostPath": {
|
||||
"path": "/mnt/master-pd/var/etcd"
|
||||
},
|
||||
"emptyDir": null,
|
||||
"gcePersistentDisk": null,
|
||||
"awsElasticBlockStore": null,
|
||||
"gitRepo": null,
|
||||
"secret": null,
|
||||
"nfs": null,
|
||||
"iscsi": null,
|
||||
"glusterfs": null
|
||||
}
|
||||
],
|
||||
"containers": [
|
||||
{
|
||||
"name": "etcd-container",
|
||||
"image": "gcr.io/google_containers/etcd:2.0.9",
|
||||
"command": [
|
||||
"/usr/local/bin/etcd",
|
||||
"--addr",
|
||||
"127.0.0.1:4001",
|
||||
"--bind-addr",
|
||||
"127.0.0.1:4001",
|
||||
"--data-dir",
|
||||
"/var/etcd/data"
|
||||
],
|
||||
"ports": [
|
||||
{
|
||||
"name": "serverport",
|
||||
"hostPort": 2380,
|
||||
"containerPort": 2380,
|
||||
"protocol": "TCP"
|
||||
},
|
||||
{
|
||||
"name": "clientport",
|
||||
"hostPort": 4001,
|
||||
"containerPort": 4001,
|
||||
"protocol": "TCP"
|
||||
}
|
||||
],
|
||||
"resources": {},
|
||||
"volumeMounts": [
|
||||
{
|
||||
"name": "varetcd",
|
||||
"mountPath": "/var/etcd"
|
||||
}
|
||||
],
|
||||
"terminationMessagePath": "/dev/termination-log",
|
||||
"imagePullPolicy": "IfNotPresent",
|
||||
"capabilities": {}
|
||||
}
|
||||
],
|
||||
"restartPolicy": "Always",
|
||||
"dnsPolicy": "ClusterFirst",
|
||||
"nodeName": "e2e-test-wojtekt-master",
|
||||
"hostNetwork": true
|
||||
},
|
||||
"status": {
|
||||
"phase": "Running",
|
||||
"conditions": [
|
||||
{
|
||||
"type": "Ready",
|
||||
"status": "True"
|
||||
}
|
||||
],
|
||||
"containerStatuses": [
|
||||
{
|
||||
"name": "etcd-container",
|
||||
"state": {
|
||||
"running": {
|
||||
"startedAt": "2015-04-22T11:49:32Z"
|
||||
}
|
||||
},
|
||||
"lastState": {},
|
||||
"ready": true,
|
||||
"restartCount": 0,
|
||||
"image": "gcr.io/google_containers/etcd:2.0.9",
|
||||
"imageID": "docker://b6b9a86dc06aa1361357ca1b105feba961f6a4145adca6c54e142c0be0fe87b0",
|
||||
"containerID": "docker://3cbbf818f1addfc252957b4504f56ef2907a313fe6afc47fc75373674255d46d"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -25,264 +25,366 @@ import (
|
||||
time "time"
|
||||
)
|
||||
|
||||
func DeepCopy_unversioned_APIGroup(in APIGroup, out *APIGroup, c *conversion.Cloner) error {
|
||||
out.TypeMeta = in.TypeMeta
|
||||
out.Name = in.Name
|
||||
if in.Versions != nil {
|
||||
in, out := in.Versions, &out.Versions
|
||||
*out = make([]GroupVersionForDiscovery, len(in))
|
||||
for i := range in {
|
||||
(*out)[i] = in[i]
|
||||
func DeepCopy_unversioned_APIGroup(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*APIGroup)
|
||||
out := out.(*APIGroup)
|
||||
out.TypeMeta = in.TypeMeta
|
||||
out.Name = in.Name
|
||||
if in.Versions != nil {
|
||||
in, out := &in.Versions, &out.Versions
|
||||
*out = make([]GroupVersionForDiscovery, len(*in))
|
||||
for i := range *in {
|
||||
(*out)[i] = (*in)[i]
|
||||
}
|
||||
} else {
|
||||
out.Versions = nil
|
||||
}
|
||||
} else {
|
||||
out.Versions = nil
|
||||
}
|
||||
out.PreferredVersion = in.PreferredVersion
|
||||
if in.ServerAddressByClientCIDRs != nil {
|
||||
in, out := in.ServerAddressByClientCIDRs, &out.ServerAddressByClientCIDRs
|
||||
*out = make([]ServerAddressByClientCIDR, len(in))
|
||||
for i := range in {
|
||||
(*out)[i] = in[i]
|
||||
out.PreferredVersion = in.PreferredVersion
|
||||
if in.ServerAddressByClientCIDRs != nil {
|
||||
in, out := &in.ServerAddressByClientCIDRs, &out.ServerAddressByClientCIDRs
|
||||
*out = make([]ServerAddressByClientCIDR, len(*in))
|
||||
for i := range *in {
|
||||
(*out)[i] = (*in)[i]
|
||||
}
|
||||
} else {
|
||||
out.ServerAddressByClientCIDRs = nil
|
||||
}
|
||||
} else {
|
||||
out.ServerAddressByClientCIDRs = nil
|
||||
return nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_APIGroupList(in APIGroupList, out *APIGroupList, c *conversion.Cloner) error {
|
||||
out.TypeMeta = in.TypeMeta
|
||||
if in.Groups != nil {
|
||||
in, out := in.Groups, &out.Groups
|
||||
*out = make([]APIGroup, len(in))
|
||||
for i := range in {
|
||||
if err := DeepCopy_unversioned_APIGroup(in[i], &(*out)[i], c); err != nil {
|
||||
func DeepCopy_unversioned_APIGroupList(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*APIGroupList)
|
||||
out := out.(*APIGroupList)
|
||||
out.TypeMeta = in.TypeMeta
|
||||
if in.Groups != nil {
|
||||
in, out := &in.Groups, &out.Groups
|
||||
*out = make([]APIGroup, len(*in))
|
||||
for i := range *in {
|
||||
if err := DeepCopy_unversioned_APIGroup(&(*in)[i], &(*out)[i], c); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.Groups = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_APIResource(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*APIResource)
|
||||
out := out.(*APIResource)
|
||||
out.Name = in.Name
|
||||
out.Namespaced = in.Namespaced
|
||||
out.Kind = in.Kind
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_APIResourceList(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*APIResourceList)
|
||||
out := out.(*APIResourceList)
|
||||
out.TypeMeta = in.TypeMeta
|
||||
out.GroupVersion = in.GroupVersion
|
||||
if in.APIResources != nil {
|
||||
in, out := &in.APIResources, &out.APIResources
|
||||
*out = make([]APIResource, len(*in))
|
||||
for i := range *in {
|
||||
(*out)[i] = (*in)[i]
|
||||
}
|
||||
} else {
|
||||
out.APIResources = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_APIVersions(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*APIVersions)
|
||||
out := out.(*APIVersions)
|
||||
out.TypeMeta = in.TypeMeta
|
||||
if in.Versions != nil {
|
||||
in, out := &in.Versions, &out.Versions
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
} else {
|
||||
out.Versions = nil
|
||||
}
|
||||
if in.ServerAddressByClientCIDRs != nil {
|
||||
in, out := &in.ServerAddressByClientCIDRs, &out.ServerAddressByClientCIDRs
|
||||
*out = make([]ServerAddressByClientCIDR, len(*in))
|
||||
for i := range *in {
|
||||
(*out)[i] = (*in)[i]
|
||||
}
|
||||
} else {
|
||||
out.ServerAddressByClientCIDRs = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_Duration(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*Duration)
|
||||
out := out.(*Duration)
|
||||
out.Duration = in.Duration
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_ExportOptions(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*ExportOptions)
|
||||
out := out.(*ExportOptions)
|
||||
out.TypeMeta = in.TypeMeta
|
||||
out.Export = in.Export
|
||||
out.Exact = in.Exact
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_GroupKind(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*GroupKind)
|
||||
out := out.(*GroupKind)
|
||||
out.Group = in.Group
|
||||
out.Kind = in.Kind
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_GroupResource(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*GroupResource)
|
||||
out := out.(*GroupResource)
|
||||
out.Group = in.Group
|
||||
out.Resource = in.Resource
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_GroupVersion(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*GroupVersion)
|
||||
out := out.(*GroupVersion)
|
||||
out.Group = in.Group
|
||||
out.Version = in.Version
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_GroupVersionForDiscovery(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*GroupVersionForDiscovery)
|
||||
out := out.(*GroupVersionForDiscovery)
|
||||
out.GroupVersion = in.GroupVersion
|
||||
out.Version = in.Version
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_GroupVersionKind(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*GroupVersionKind)
|
||||
out := out.(*GroupVersionKind)
|
||||
out.Group = in.Group
|
||||
out.Version = in.Version
|
||||
out.Kind = in.Kind
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_GroupVersionResource(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*GroupVersionResource)
|
||||
out := out.(*GroupVersionResource)
|
||||
out.Group = in.Group
|
||||
out.Version = in.Version
|
||||
out.Resource = in.Resource
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_LabelSelector(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*LabelSelector)
|
||||
out := out.(*LabelSelector)
|
||||
if in.MatchLabels != nil {
|
||||
in, out := &in.MatchLabels, &out.MatchLabels
|
||||
*out = make(map[string]string)
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
} else {
|
||||
out.MatchLabels = nil
|
||||
}
|
||||
if in.MatchExpressions != nil {
|
||||
in, out := &in.MatchExpressions, &out.MatchExpressions
|
||||
*out = make([]LabelSelectorRequirement, len(*in))
|
||||
for i := range *in {
|
||||
if err := DeepCopy_unversioned_LabelSelectorRequirement(&(*in)[i], &(*out)[i], c); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.MatchExpressions = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_LabelSelectorRequirement(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*LabelSelectorRequirement)
|
||||
out := out.(*LabelSelectorRequirement)
|
||||
out.Key = in.Key
|
||||
out.Operator = in.Operator
|
||||
if in.Values != nil {
|
||||
in, out := &in.Values, &out.Values
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
} else {
|
||||
out.Values = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_ListMeta(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*ListMeta)
|
||||
out := out.(*ListMeta)
|
||||
out.SelfLink = in.SelfLink
|
||||
out.ResourceVersion = in.ResourceVersion
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_Patch(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*Patch)
|
||||
out := out.(*Patch)
|
||||
_ = in
|
||||
_ = out
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_RootPaths(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*RootPaths)
|
||||
out := out.(*RootPaths)
|
||||
if in.Paths != nil {
|
||||
in, out := &in.Paths, &out.Paths
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
} else {
|
||||
out.Paths = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_ServerAddressByClientCIDR(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*ServerAddressByClientCIDR)
|
||||
out := out.(*ServerAddressByClientCIDR)
|
||||
out.ClientCIDR = in.ClientCIDR
|
||||
out.ServerAddress = in.ServerAddress
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_Status(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*Status)
|
||||
out := out.(*Status)
|
||||
out.TypeMeta = in.TypeMeta
|
||||
out.ListMeta = in.ListMeta
|
||||
out.Status = in.Status
|
||||
out.Message = in.Message
|
||||
out.Reason = in.Reason
|
||||
if in.Details != nil {
|
||||
in, out := &in.Details, &out.Details
|
||||
*out = new(StatusDetails)
|
||||
if err := DeepCopy_unversioned_StatusDetails(*in, *out, c); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.Details = nil
|
||||
}
|
||||
} else {
|
||||
out.Groups = nil
|
||||
out.Code = in.Code
|
||||
return nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_APIResource(in APIResource, out *APIResource, c *conversion.Cloner) error {
|
||||
out.Name = in.Name
|
||||
out.Namespaced = in.Namespaced
|
||||
out.Kind = in.Kind
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_APIResourceList(in APIResourceList, out *APIResourceList, c *conversion.Cloner) error {
|
||||
out.TypeMeta = in.TypeMeta
|
||||
out.GroupVersion = in.GroupVersion
|
||||
if in.APIResources != nil {
|
||||
in, out := in.APIResources, &out.APIResources
|
||||
*out = make([]APIResource, len(in))
|
||||
for i := range in {
|
||||
(*out)[i] = in[i]
|
||||
}
|
||||
} else {
|
||||
out.APIResources = nil
|
||||
func DeepCopy_unversioned_StatusCause(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*StatusCause)
|
||||
out := out.(*StatusCause)
|
||||
out.Type = in.Type
|
||||
out.Message = in.Message
|
||||
out.Field = in.Field
|
||||
return nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_APIVersions(in APIVersions, out *APIVersions, c *conversion.Cloner) error {
|
||||
out.TypeMeta = in.TypeMeta
|
||||
if in.Versions != nil {
|
||||
in, out := in.Versions, &out.Versions
|
||||
*out = make([]string, len(in))
|
||||
copy(*out, in)
|
||||
} else {
|
||||
out.Versions = nil
|
||||
}
|
||||
if in.ServerAddressByClientCIDRs != nil {
|
||||
in, out := in.ServerAddressByClientCIDRs, &out.ServerAddressByClientCIDRs
|
||||
*out = make([]ServerAddressByClientCIDR, len(in))
|
||||
for i := range in {
|
||||
(*out)[i] = in[i]
|
||||
}
|
||||
} else {
|
||||
out.ServerAddressByClientCIDRs = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_Duration(in Duration, out *Duration, c *conversion.Cloner) error {
|
||||
out.Duration = in.Duration
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_ExportOptions(in ExportOptions, out *ExportOptions, c *conversion.Cloner) error {
|
||||
out.TypeMeta = in.TypeMeta
|
||||
out.Export = in.Export
|
||||
out.Exact = in.Exact
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_GroupKind(in GroupKind, out *GroupKind, c *conversion.Cloner) error {
|
||||
out.Group = in.Group
|
||||
out.Kind = in.Kind
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_GroupResource(in GroupResource, out *GroupResource, c *conversion.Cloner) error {
|
||||
out.Group = in.Group
|
||||
out.Resource = in.Resource
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_GroupVersion(in GroupVersion, out *GroupVersion, c *conversion.Cloner) error {
|
||||
out.Group = in.Group
|
||||
out.Version = in.Version
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_GroupVersionForDiscovery(in GroupVersionForDiscovery, out *GroupVersionForDiscovery, c *conversion.Cloner) error {
|
||||
out.GroupVersion = in.GroupVersion
|
||||
out.Version = in.Version
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_GroupVersionKind(in GroupVersionKind, out *GroupVersionKind, c *conversion.Cloner) error {
|
||||
out.Group = in.Group
|
||||
out.Version = in.Version
|
||||
out.Kind = in.Kind
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_GroupVersionResource(in GroupVersionResource, out *GroupVersionResource, c *conversion.Cloner) error {
|
||||
out.Group = in.Group
|
||||
out.Version = in.Version
|
||||
out.Resource = in.Resource
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_LabelSelector(in LabelSelector, out *LabelSelector, c *conversion.Cloner) error {
|
||||
if in.MatchLabels != nil {
|
||||
in, out := in.MatchLabels, &out.MatchLabels
|
||||
*out = make(map[string]string)
|
||||
for key, val := range in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
} else {
|
||||
out.MatchLabels = nil
|
||||
}
|
||||
if in.MatchExpressions != nil {
|
||||
in, out := in.MatchExpressions, &out.MatchExpressions
|
||||
*out = make([]LabelSelectorRequirement, len(in))
|
||||
for i := range in {
|
||||
if err := DeepCopy_unversioned_LabelSelectorRequirement(in[i], &(*out)[i], c); err != nil {
|
||||
return err
|
||||
func DeepCopy_unversioned_StatusDetails(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*StatusDetails)
|
||||
out := out.(*StatusDetails)
|
||||
out.Name = in.Name
|
||||
out.Group = in.Group
|
||||
out.Kind = in.Kind
|
||||
if in.Causes != nil {
|
||||
in, out := &in.Causes, &out.Causes
|
||||
*out = make([]StatusCause, len(*in))
|
||||
for i := range *in {
|
||||
(*out)[i] = (*in)[i]
|
||||
}
|
||||
} else {
|
||||
out.Causes = nil
|
||||
}
|
||||
} else {
|
||||
out.MatchExpressions = nil
|
||||
out.RetryAfterSeconds = in.RetryAfterSeconds
|
||||
return nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_LabelSelectorRequirement(in LabelSelectorRequirement, out *LabelSelectorRequirement, c *conversion.Cloner) error {
|
||||
out.Key = in.Key
|
||||
out.Operator = in.Operator
|
||||
if in.Values != nil {
|
||||
in, out := in.Values, &out.Values
|
||||
*out = make([]string, len(in))
|
||||
copy(*out, in)
|
||||
} else {
|
||||
out.Values = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_ListMeta(in ListMeta, out *ListMeta, c *conversion.Cloner) error {
|
||||
out.SelfLink = in.SelfLink
|
||||
out.ResourceVersion = in.ResourceVersion
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_Patch(in Patch, out *Patch, c *conversion.Cloner) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_RootPaths(in RootPaths, out *RootPaths, c *conversion.Cloner) error {
|
||||
if in.Paths != nil {
|
||||
in, out := in.Paths, &out.Paths
|
||||
*out = make([]string, len(in))
|
||||
copy(*out, in)
|
||||
} else {
|
||||
out.Paths = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_ServerAddressByClientCIDR(in ServerAddressByClientCIDR, out *ServerAddressByClientCIDR, c *conversion.Cloner) error {
|
||||
out.ClientCIDR = in.ClientCIDR
|
||||
out.ServerAddress = in.ServerAddress
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_Status(in Status, out *Status, c *conversion.Cloner) error {
|
||||
out.TypeMeta = in.TypeMeta
|
||||
out.ListMeta = in.ListMeta
|
||||
out.Status = in.Status
|
||||
out.Message = in.Message
|
||||
out.Reason = in.Reason
|
||||
if in.Details != nil {
|
||||
in, out := in.Details, &out.Details
|
||||
*out = new(StatusDetails)
|
||||
if err := DeepCopy_unversioned_StatusDetails(*in, *out, c); err != nil {
|
||||
func DeepCopy_unversioned_Time(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*Time)
|
||||
out := out.(*Time)
|
||||
if newVal, err := c.DeepCopy(&in.Time); err != nil {
|
||||
return err
|
||||
} else {
|
||||
out.Time = *newVal.(*time.Time)
|
||||
}
|
||||
} else {
|
||||
out.Details = nil
|
||||
return nil
|
||||
}
|
||||
out.Code = in.Code
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_StatusCause(in StatusCause, out *StatusCause, c *conversion.Cloner) error {
|
||||
out.Type = in.Type
|
||||
out.Message = in.Message
|
||||
out.Field = in.Field
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_StatusDetails(in StatusDetails, out *StatusDetails, c *conversion.Cloner) error {
|
||||
out.Name = in.Name
|
||||
out.Group = in.Group
|
||||
out.Kind = in.Kind
|
||||
if in.Causes != nil {
|
||||
in, out := in.Causes, &out.Causes
|
||||
*out = make([]StatusCause, len(in))
|
||||
for i := range in {
|
||||
(*out)[i] = in[i]
|
||||
}
|
||||
} else {
|
||||
out.Causes = nil
|
||||
func DeepCopy_unversioned_Timestamp(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*Timestamp)
|
||||
out := out.(*Timestamp)
|
||||
out.Seconds = in.Seconds
|
||||
out.Nanos = in.Nanos
|
||||
return nil
|
||||
}
|
||||
out.RetryAfterSeconds = in.RetryAfterSeconds
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_Time(in Time, out *Time, c *conversion.Cloner) error {
|
||||
if newVal, err := c.DeepCopy(in.Time); err != nil {
|
||||
return err
|
||||
} else {
|
||||
out.Time = newVal.(time.Time)
|
||||
func DeepCopy_unversioned_TypeMeta(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*TypeMeta)
|
||||
out := out.(*TypeMeta)
|
||||
out.Kind = in.Kind
|
||||
out.APIVersion = in.APIVersion
|
||||
return nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_Timestamp(in Timestamp, out *Timestamp, c *conversion.Cloner) error {
|
||||
out.Seconds = in.Seconds
|
||||
out.Nanos = in.Nanos
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_unversioned_TypeMeta(in TypeMeta, out *TypeMeta, c *conversion.Cloner) error {
|
||||
out.Kind = in.Kind
|
||||
out.APIVersion = in.APIVersion
|
||||
return nil
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user