Merge pull request #65050 from sttts/sttts-deepcopy-update

Automatic merge from submit-queue (batch tested with PRs 64895, 64938, 63700, 65050, 64957). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Bump gengo to include uniform pointer deepcopy

This bumps k8s.io/gengo with uniform pointer support in deepcopy-gen.

Fixes https://github.com/kubernetes/code-generator/issues/45.

Kubernetes-commit: d1f5cb2348dfaeabe26ff5539b05568ab6f8a830
This commit is contained in:
Kubernetes Publisher
2018-06-21 16:35:17 +00:00
41 changed files with 1209 additions and 2716 deletions
+226 -226
View File
File diff suppressed because it is too large Load Diff
@@ -90,13 +90,9 @@ func (in *FooSpec) DeepCopyInto(out *FooSpec) {
*out = *in *out = *in
if in.Replicas != nil { if in.Replicas != nil {
in, out := &in.Replicas, &out.Replicas in, out := &in.Replicas, &out.Replicas
if *in == nil {
*out = nil
} else {
*out = new(int32) *out = new(int32)
**out = **in **out = **in
} }
}
return return
} }
@@ -149,13 +149,9 @@ func (in *ServiceReference) DeepCopyInto(out *ServiceReference) {
*out = *in *out = *in
if in.Path != nil { if in.Path != nil {
in, out := &in.Path, &out.Path in, out := &in.Path, &out.Path
if *in == nil {
*out = nil
} else {
*out = new(string) *out = new(string)
**out = **in **out = **in
} }
}
return return
} }
@@ -248,22 +244,14 @@ func (in *Webhook) DeepCopyInto(out *Webhook) {
} }
if in.FailurePolicy != nil { if in.FailurePolicy != nil {
in, out := &in.FailurePolicy, &out.FailurePolicy in, out := &in.FailurePolicy, &out.FailurePolicy
if *in == nil {
*out = nil
} else {
*out = new(FailurePolicyType) *out = new(FailurePolicyType)
**out = **in **out = **in
} }
}
if in.NamespaceSelector != nil { if in.NamespaceSelector != nil {
in, out := &in.NamespaceSelector, &out.NamespaceSelector in, out := &in.NamespaceSelector, &out.NamespaceSelector
if *in == nil {
*out = nil
} else {
*out = new(v1.LabelSelector) *out = new(v1.LabelSelector)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
return return
} }
@@ -282,22 +270,14 @@ func (in *WebhookClientConfig) DeepCopyInto(out *WebhookClientConfig) {
*out = *in *out = *in
if in.URL != nil { if in.URL != nil {
in, out := &in.URL, &out.URL in, out := &in.URL, &out.URL
if *in == nil {
*out = nil
} else {
*out = new(string) *out = new(string)
**out = **in **out = **in
} }
}
if in.Service != nil { if in.Service != nil {
in, out := &in.Service, &out.Service in, out := &in.Service, &out.Service
if *in == nil {
*out = nil
} else {
*out = new(ServiceReference) *out = new(ServiceReference)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
if in.CABundle != nil { if in.CABundle != nil {
in, out := &in.CABundle, &out.CABundle in, out := &in.CABundle, &out.CABundle
*out = make([]byte, len(*in)) *out = make([]byte, len(*in))
-84
View File
@@ -170,24 +170,16 @@ func (in *DaemonSetSpec) DeepCopyInto(out *DaemonSetSpec) {
*out = *in *out = *in
if in.Selector != nil { if in.Selector != nil {
in, out := &in.Selector, &out.Selector in, out := &in.Selector, &out.Selector
if *in == nil {
*out = nil
} else {
*out = new(meta_v1.LabelSelector) *out = new(meta_v1.LabelSelector)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
in.Template.DeepCopyInto(&out.Template) in.Template.DeepCopyInto(&out.Template)
in.UpdateStrategy.DeepCopyInto(&out.UpdateStrategy) in.UpdateStrategy.DeepCopyInto(&out.UpdateStrategy)
if in.RevisionHistoryLimit != nil { if in.RevisionHistoryLimit != nil {
in, out := &in.RevisionHistoryLimit, &out.RevisionHistoryLimit in, out := &in.RevisionHistoryLimit, &out.RevisionHistoryLimit
if *in == nil {
*out = nil
} else {
*out = new(int32) *out = new(int32)
**out = **in **out = **in
} }
}
return return
} }
@@ -206,13 +198,9 @@ func (in *DaemonSetStatus) DeepCopyInto(out *DaemonSetStatus) {
*out = *in *out = *in
if in.CollisionCount != nil { if in.CollisionCount != nil {
in, out := &in.CollisionCount, &out.CollisionCount in, out := &in.CollisionCount, &out.CollisionCount
if *in == nil {
*out = nil
} else {
*out = new(int32) *out = new(int32)
**out = **in **out = **in
} }
}
if in.Conditions != nil { if in.Conditions != nil {
in, out := &in.Conditions, &out.Conditions in, out := &in.Conditions, &out.Conditions
*out = make([]DaemonSetCondition, len(*in)) *out = make([]DaemonSetCondition, len(*in))
@@ -238,13 +226,9 @@ func (in *DaemonSetUpdateStrategy) DeepCopyInto(out *DaemonSetUpdateStrategy) {
*out = *in *out = *in
if in.RollingUpdate != nil { if in.RollingUpdate != nil {
in, out := &in.RollingUpdate, &out.RollingUpdate in, out := &in.RollingUpdate, &out.RollingUpdate
if *in == nil {
*out = nil
} else {
*out = new(RollingUpdateDaemonSet) *out = new(RollingUpdateDaemonSet)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
return return
} }
@@ -342,42 +326,26 @@ func (in *DeploymentSpec) DeepCopyInto(out *DeploymentSpec) {
*out = *in *out = *in
if in.Replicas != nil { if in.Replicas != nil {
in, out := &in.Replicas, &out.Replicas in, out := &in.Replicas, &out.Replicas
if *in == nil {
*out = nil
} else {
*out = new(int32) *out = new(int32)
**out = **in **out = **in
} }
}
if in.Selector != nil { if in.Selector != nil {
in, out := &in.Selector, &out.Selector in, out := &in.Selector, &out.Selector
if *in == nil {
*out = nil
} else {
*out = new(meta_v1.LabelSelector) *out = new(meta_v1.LabelSelector)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
in.Template.DeepCopyInto(&out.Template) in.Template.DeepCopyInto(&out.Template)
in.Strategy.DeepCopyInto(&out.Strategy) in.Strategy.DeepCopyInto(&out.Strategy)
if in.RevisionHistoryLimit != nil { if in.RevisionHistoryLimit != nil {
in, out := &in.RevisionHistoryLimit, &out.RevisionHistoryLimit in, out := &in.RevisionHistoryLimit, &out.RevisionHistoryLimit
if *in == nil {
*out = nil
} else {
*out = new(int32) *out = new(int32)
**out = **in **out = **in
} }
}
if in.ProgressDeadlineSeconds != nil { if in.ProgressDeadlineSeconds != nil {
in, out := &in.ProgressDeadlineSeconds, &out.ProgressDeadlineSeconds in, out := &in.ProgressDeadlineSeconds, &out.ProgressDeadlineSeconds
if *in == nil {
*out = nil
} else {
*out = new(int32) *out = new(int32)
**out = **in **out = **in
} }
}
return return
} }
@@ -403,13 +371,9 @@ func (in *DeploymentStatus) DeepCopyInto(out *DeploymentStatus) {
} }
if in.CollisionCount != nil { if in.CollisionCount != nil {
in, out := &in.CollisionCount, &out.CollisionCount in, out := &in.CollisionCount, &out.CollisionCount
if *in == nil {
*out = nil
} else {
*out = new(int32) *out = new(int32)
**out = **in **out = **in
} }
}
return return
} }
@@ -428,13 +392,9 @@ func (in *DeploymentStrategy) DeepCopyInto(out *DeploymentStrategy) {
*out = *in *out = *in
if in.RollingUpdate != nil { if in.RollingUpdate != nil {
in, out := &in.RollingUpdate, &out.RollingUpdate in, out := &in.RollingUpdate, &out.RollingUpdate
if *in == nil {
*out = nil
} else {
*out = new(RollingUpdateDeployment) *out = new(RollingUpdateDeployment)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
return return
} }
@@ -531,22 +491,14 @@ func (in *ReplicaSetSpec) DeepCopyInto(out *ReplicaSetSpec) {
*out = *in *out = *in
if in.Replicas != nil { if in.Replicas != nil {
in, out := &in.Replicas, &out.Replicas in, out := &in.Replicas, &out.Replicas
if *in == nil {
*out = nil
} else {
*out = new(int32) *out = new(int32)
**out = **in **out = **in
} }
}
if in.Selector != nil { if in.Selector != nil {
in, out := &in.Selector, &out.Selector in, out := &in.Selector, &out.Selector
if *in == nil {
*out = nil
} else {
*out = new(meta_v1.LabelSelector) *out = new(meta_v1.LabelSelector)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
in.Template.DeepCopyInto(&out.Template) in.Template.DeepCopyInto(&out.Template)
return return
} }
@@ -589,13 +541,9 @@ func (in *RollingUpdateDaemonSet) DeepCopyInto(out *RollingUpdateDaemonSet) {
*out = *in *out = *in
if in.MaxUnavailable != nil { if in.MaxUnavailable != nil {
in, out := &in.MaxUnavailable, &out.MaxUnavailable in, out := &in.MaxUnavailable, &out.MaxUnavailable
if *in == nil {
*out = nil
} else {
*out = new(intstr.IntOrString) *out = new(intstr.IntOrString)
**out = **in **out = **in
} }
}
return return
} }
@@ -614,22 +562,14 @@ func (in *RollingUpdateDeployment) DeepCopyInto(out *RollingUpdateDeployment) {
*out = *in *out = *in
if in.MaxUnavailable != nil { if in.MaxUnavailable != nil {
in, out := &in.MaxUnavailable, &out.MaxUnavailable in, out := &in.MaxUnavailable, &out.MaxUnavailable
if *in == nil {
*out = nil
} else {
*out = new(intstr.IntOrString) *out = new(intstr.IntOrString)
**out = **in **out = **in
} }
}
if in.MaxSurge != nil { if in.MaxSurge != nil {
in, out := &in.MaxSurge, &out.MaxSurge in, out := &in.MaxSurge, &out.MaxSurge
if *in == nil {
*out = nil
} else {
*out = new(intstr.IntOrString) *out = new(intstr.IntOrString)
**out = **in **out = **in
} }
}
return return
} }
@@ -648,13 +588,9 @@ func (in *RollingUpdateStatefulSetStrategy) DeepCopyInto(out *RollingUpdateState
*out = *in *out = *in
if in.Partition != nil { if in.Partition != nil {
in, out := &in.Partition, &out.Partition in, out := &in.Partition, &out.Partition
if *in == nil {
*out = nil
} else {
*out = new(int32) *out = new(int32)
**out = **in **out = **in
} }
}
return return
} }
@@ -751,22 +687,14 @@ func (in *StatefulSetSpec) DeepCopyInto(out *StatefulSetSpec) {
*out = *in *out = *in
if in.Replicas != nil { if in.Replicas != nil {
in, out := &in.Replicas, &out.Replicas in, out := &in.Replicas, &out.Replicas
if *in == nil {
*out = nil
} else {
*out = new(int32) *out = new(int32)
**out = **in **out = **in
} }
}
if in.Selector != nil { if in.Selector != nil {
in, out := &in.Selector, &out.Selector in, out := &in.Selector, &out.Selector
if *in == nil {
*out = nil
} else {
*out = new(meta_v1.LabelSelector) *out = new(meta_v1.LabelSelector)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
in.Template.DeepCopyInto(&out.Template) in.Template.DeepCopyInto(&out.Template)
if in.VolumeClaimTemplates != nil { if in.VolumeClaimTemplates != nil {
in, out := &in.VolumeClaimTemplates, &out.VolumeClaimTemplates in, out := &in.VolumeClaimTemplates, &out.VolumeClaimTemplates
@@ -778,13 +706,9 @@ func (in *StatefulSetSpec) DeepCopyInto(out *StatefulSetSpec) {
in.UpdateStrategy.DeepCopyInto(&out.UpdateStrategy) in.UpdateStrategy.DeepCopyInto(&out.UpdateStrategy)
if in.RevisionHistoryLimit != nil { if in.RevisionHistoryLimit != nil {
in, out := &in.RevisionHistoryLimit, &out.RevisionHistoryLimit in, out := &in.RevisionHistoryLimit, &out.RevisionHistoryLimit
if *in == nil {
*out = nil
} else {
*out = new(int32) *out = new(int32)
**out = **in **out = **in
} }
}
return return
} }
@@ -803,13 +727,9 @@ func (in *StatefulSetStatus) DeepCopyInto(out *StatefulSetStatus) {
*out = *in *out = *in
if in.CollisionCount != nil { if in.CollisionCount != nil {
in, out := &in.CollisionCount, &out.CollisionCount in, out := &in.CollisionCount, &out.CollisionCount
if *in == nil {
*out = nil
} else {
*out = new(int32) *out = new(int32)
**out = **in **out = **in
} }
}
if in.Conditions != nil { if in.Conditions != nil {
in, out := &in.Conditions, &out.Conditions in, out := &in.Conditions, &out.Conditions
*out = make([]StatefulSetCondition, len(*in)) *out = make([]StatefulSetCondition, len(*in))
@@ -835,13 +755,9 @@ func (in *StatefulSetUpdateStrategy) DeepCopyInto(out *StatefulSetUpdateStrategy
*out = *in *out = *in
if in.RollingUpdate != nil { if in.RollingUpdate != nil {
in, out := &in.RollingUpdate, &out.RollingUpdate in, out := &in.RollingUpdate, &out.RollingUpdate
if *in == nil {
*out = nil
} else {
*out = new(RollingUpdateStatefulSetStrategy) *out = new(RollingUpdateStatefulSetStrategy)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
return return
} }
-64
View File
@@ -204,51 +204,31 @@ func (in *DeploymentSpec) DeepCopyInto(out *DeploymentSpec) {
*out = *in *out = *in
if in.Replicas != nil { if in.Replicas != nil {
in, out := &in.Replicas, &out.Replicas in, out := &in.Replicas, &out.Replicas
if *in == nil {
*out = nil
} else {
*out = new(int32) *out = new(int32)
**out = **in **out = **in
} }
}
if in.Selector != nil { if in.Selector != nil {
in, out := &in.Selector, &out.Selector in, out := &in.Selector, &out.Selector
if *in == nil {
*out = nil
} else {
*out = new(v1.LabelSelector) *out = new(v1.LabelSelector)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
in.Template.DeepCopyInto(&out.Template) in.Template.DeepCopyInto(&out.Template)
in.Strategy.DeepCopyInto(&out.Strategy) in.Strategy.DeepCopyInto(&out.Strategy)
if in.RevisionHistoryLimit != nil { if in.RevisionHistoryLimit != nil {
in, out := &in.RevisionHistoryLimit, &out.RevisionHistoryLimit in, out := &in.RevisionHistoryLimit, &out.RevisionHistoryLimit
if *in == nil {
*out = nil
} else {
*out = new(int32) *out = new(int32)
**out = **in **out = **in
} }
}
if in.RollbackTo != nil { if in.RollbackTo != nil {
in, out := &in.RollbackTo, &out.RollbackTo in, out := &in.RollbackTo, &out.RollbackTo
if *in == nil {
*out = nil
} else {
*out = new(RollbackConfig) *out = new(RollbackConfig)
**out = **in **out = **in
} }
}
if in.ProgressDeadlineSeconds != nil { if in.ProgressDeadlineSeconds != nil {
in, out := &in.ProgressDeadlineSeconds, &out.ProgressDeadlineSeconds in, out := &in.ProgressDeadlineSeconds, &out.ProgressDeadlineSeconds
if *in == nil {
*out = nil
} else {
*out = new(int32) *out = new(int32)
**out = **in **out = **in
} }
}
return return
} }
@@ -274,13 +254,9 @@ func (in *DeploymentStatus) DeepCopyInto(out *DeploymentStatus) {
} }
if in.CollisionCount != nil { if in.CollisionCount != nil {
in, out := &in.CollisionCount, &out.CollisionCount in, out := &in.CollisionCount, &out.CollisionCount
if *in == nil {
*out = nil
} else {
*out = new(int32) *out = new(int32)
**out = **in **out = **in
} }
}
return return
} }
@@ -299,13 +275,9 @@ func (in *DeploymentStrategy) DeepCopyInto(out *DeploymentStrategy) {
*out = *in *out = *in
if in.RollingUpdate != nil { if in.RollingUpdate != nil {
in, out := &in.RollingUpdate, &out.RollingUpdate in, out := &in.RollingUpdate, &out.RollingUpdate
if *in == nil {
*out = nil
} else {
*out = new(RollingUpdateDeployment) *out = new(RollingUpdateDeployment)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
return return
} }
@@ -340,22 +312,14 @@ func (in *RollingUpdateDeployment) DeepCopyInto(out *RollingUpdateDeployment) {
*out = *in *out = *in
if in.MaxUnavailable != nil { if in.MaxUnavailable != nil {
in, out := &in.MaxUnavailable, &out.MaxUnavailable in, out := &in.MaxUnavailable, &out.MaxUnavailable
if *in == nil {
*out = nil
} else {
*out = new(intstr.IntOrString) *out = new(intstr.IntOrString)
**out = **in **out = **in
} }
}
if in.MaxSurge != nil { if in.MaxSurge != nil {
in, out := &in.MaxSurge, &out.MaxSurge in, out := &in.MaxSurge, &out.MaxSurge
if *in == nil {
*out = nil
} else {
*out = new(intstr.IntOrString) *out = new(intstr.IntOrString)
**out = **in **out = **in
} }
}
return return
} }
@@ -374,13 +338,9 @@ func (in *RollingUpdateStatefulSetStrategy) DeepCopyInto(out *RollingUpdateState
*out = *in *out = *in
if in.Partition != nil { if in.Partition != nil {
in, out := &in.Partition, &out.Partition in, out := &in.Partition, &out.Partition
if *in == nil {
*out = nil
} else {
*out = new(int32) *out = new(int32)
**out = **in **out = **in
} }
}
return return
} }
@@ -544,22 +504,14 @@ func (in *StatefulSetSpec) DeepCopyInto(out *StatefulSetSpec) {
*out = *in *out = *in
if in.Replicas != nil { if in.Replicas != nil {
in, out := &in.Replicas, &out.Replicas in, out := &in.Replicas, &out.Replicas
if *in == nil {
*out = nil
} else {
*out = new(int32) *out = new(int32)
**out = **in **out = **in
} }
}
if in.Selector != nil { if in.Selector != nil {
in, out := &in.Selector, &out.Selector in, out := &in.Selector, &out.Selector
if *in == nil {
*out = nil
} else {
*out = new(v1.LabelSelector) *out = new(v1.LabelSelector)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
in.Template.DeepCopyInto(&out.Template) in.Template.DeepCopyInto(&out.Template)
if in.VolumeClaimTemplates != nil { if in.VolumeClaimTemplates != nil {
in, out := &in.VolumeClaimTemplates, &out.VolumeClaimTemplates in, out := &in.VolumeClaimTemplates, &out.VolumeClaimTemplates
@@ -571,13 +523,9 @@ func (in *StatefulSetSpec) DeepCopyInto(out *StatefulSetSpec) {
in.UpdateStrategy.DeepCopyInto(&out.UpdateStrategy) in.UpdateStrategy.DeepCopyInto(&out.UpdateStrategy)
if in.RevisionHistoryLimit != nil { if in.RevisionHistoryLimit != nil {
in, out := &in.RevisionHistoryLimit, &out.RevisionHistoryLimit in, out := &in.RevisionHistoryLimit, &out.RevisionHistoryLimit
if *in == nil {
*out = nil
} else {
*out = new(int32) *out = new(int32)
**out = **in **out = **in
} }
}
return return
} }
@@ -596,22 +544,14 @@ func (in *StatefulSetStatus) DeepCopyInto(out *StatefulSetStatus) {
*out = *in *out = *in
if in.ObservedGeneration != nil { if in.ObservedGeneration != nil {
in, out := &in.ObservedGeneration, &out.ObservedGeneration in, out := &in.ObservedGeneration, &out.ObservedGeneration
if *in == nil {
*out = nil
} else {
*out = new(int64) *out = new(int64)
**out = **in **out = **in
} }
}
if in.CollisionCount != nil { if in.CollisionCount != nil {
in, out := &in.CollisionCount, &out.CollisionCount in, out := &in.CollisionCount, &out.CollisionCount
if *in == nil {
*out = nil
} else {
*out = new(int32) *out = new(int32)
**out = **in **out = **in
} }
}
if in.Conditions != nil { if in.Conditions != nil {
in, out := &in.Conditions, &out.Conditions in, out := &in.Conditions, &out.Conditions
*out = make([]StatefulSetCondition, len(*in)) *out = make([]StatefulSetCondition, len(*in))
@@ -637,13 +577,9 @@ func (in *StatefulSetUpdateStrategy) DeepCopyInto(out *StatefulSetUpdateStrategy
*out = *in *out = *in
if in.RollingUpdate != nil { if in.RollingUpdate != nil {
in, out := &in.RollingUpdate, &out.RollingUpdate in, out := &in.RollingUpdate, &out.RollingUpdate
if *in == nil {
*out = nil
} else {
*out = new(RollingUpdateStatefulSetStrategy) *out = new(RollingUpdateStatefulSetStrategy)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
return return
} }
-84
View File
@@ -170,24 +170,16 @@ func (in *DaemonSetSpec) DeepCopyInto(out *DaemonSetSpec) {
*out = *in *out = *in
if in.Selector != nil { if in.Selector != nil {
in, out := &in.Selector, &out.Selector in, out := &in.Selector, &out.Selector
if *in == nil {
*out = nil
} else {
*out = new(v1.LabelSelector) *out = new(v1.LabelSelector)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
in.Template.DeepCopyInto(&out.Template) in.Template.DeepCopyInto(&out.Template)
in.UpdateStrategy.DeepCopyInto(&out.UpdateStrategy) in.UpdateStrategy.DeepCopyInto(&out.UpdateStrategy)
if in.RevisionHistoryLimit != nil { if in.RevisionHistoryLimit != nil {
in, out := &in.RevisionHistoryLimit, &out.RevisionHistoryLimit in, out := &in.RevisionHistoryLimit, &out.RevisionHistoryLimit
if *in == nil {
*out = nil
} else {
*out = new(int32) *out = new(int32)
**out = **in **out = **in
} }
}
return return
} }
@@ -206,13 +198,9 @@ func (in *DaemonSetStatus) DeepCopyInto(out *DaemonSetStatus) {
*out = *in *out = *in
if in.CollisionCount != nil { if in.CollisionCount != nil {
in, out := &in.CollisionCount, &out.CollisionCount in, out := &in.CollisionCount, &out.CollisionCount
if *in == nil {
*out = nil
} else {
*out = new(int32) *out = new(int32)
**out = **in **out = **in
} }
}
if in.Conditions != nil { if in.Conditions != nil {
in, out := &in.Conditions, &out.Conditions in, out := &in.Conditions, &out.Conditions
*out = make([]DaemonSetCondition, len(*in)) *out = make([]DaemonSetCondition, len(*in))
@@ -238,13 +226,9 @@ func (in *DaemonSetUpdateStrategy) DeepCopyInto(out *DaemonSetUpdateStrategy) {
*out = *in *out = *in
if in.RollingUpdate != nil { if in.RollingUpdate != nil {
in, out := &in.RollingUpdate, &out.RollingUpdate in, out := &in.RollingUpdate, &out.RollingUpdate
if *in == nil {
*out = nil
} else {
*out = new(RollingUpdateDaemonSet) *out = new(RollingUpdateDaemonSet)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
return return
} }
@@ -342,42 +326,26 @@ func (in *DeploymentSpec) DeepCopyInto(out *DeploymentSpec) {
*out = *in *out = *in
if in.Replicas != nil { if in.Replicas != nil {
in, out := &in.Replicas, &out.Replicas in, out := &in.Replicas, &out.Replicas
if *in == nil {
*out = nil
} else {
*out = new(int32) *out = new(int32)
**out = **in **out = **in
} }
}
if in.Selector != nil { if in.Selector != nil {
in, out := &in.Selector, &out.Selector in, out := &in.Selector, &out.Selector
if *in == nil {
*out = nil
} else {
*out = new(v1.LabelSelector) *out = new(v1.LabelSelector)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
in.Template.DeepCopyInto(&out.Template) in.Template.DeepCopyInto(&out.Template)
in.Strategy.DeepCopyInto(&out.Strategy) in.Strategy.DeepCopyInto(&out.Strategy)
if in.RevisionHistoryLimit != nil { if in.RevisionHistoryLimit != nil {
in, out := &in.RevisionHistoryLimit, &out.RevisionHistoryLimit in, out := &in.RevisionHistoryLimit, &out.RevisionHistoryLimit
if *in == nil {
*out = nil
} else {
*out = new(int32) *out = new(int32)
**out = **in **out = **in
} }
}
if in.ProgressDeadlineSeconds != nil { if in.ProgressDeadlineSeconds != nil {
in, out := &in.ProgressDeadlineSeconds, &out.ProgressDeadlineSeconds in, out := &in.ProgressDeadlineSeconds, &out.ProgressDeadlineSeconds
if *in == nil {
*out = nil
} else {
*out = new(int32) *out = new(int32)
**out = **in **out = **in
} }
}
return return
} }
@@ -403,13 +371,9 @@ func (in *DeploymentStatus) DeepCopyInto(out *DeploymentStatus) {
} }
if in.CollisionCount != nil { if in.CollisionCount != nil {
in, out := &in.CollisionCount, &out.CollisionCount in, out := &in.CollisionCount, &out.CollisionCount
if *in == nil {
*out = nil
} else {
*out = new(int32) *out = new(int32)
**out = **in **out = **in
} }
}
return return
} }
@@ -428,13 +392,9 @@ func (in *DeploymentStrategy) DeepCopyInto(out *DeploymentStrategy) {
*out = *in *out = *in
if in.RollingUpdate != nil { if in.RollingUpdate != nil {
in, out := &in.RollingUpdate, &out.RollingUpdate in, out := &in.RollingUpdate, &out.RollingUpdate
if *in == nil {
*out = nil
} else {
*out = new(RollingUpdateDeployment) *out = new(RollingUpdateDeployment)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
return return
} }
@@ -531,22 +491,14 @@ func (in *ReplicaSetSpec) DeepCopyInto(out *ReplicaSetSpec) {
*out = *in *out = *in
if in.Replicas != nil { if in.Replicas != nil {
in, out := &in.Replicas, &out.Replicas in, out := &in.Replicas, &out.Replicas
if *in == nil {
*out = nil
} else {
*out = new(int32) *out = new(int32)
**out = **in **out = **in
} }
}
if in.Selector != nil { if in.Selector != nil {
in, out := &in.Selector, &out.Selector in, out := &in.Selector, &out.Selector
if *in == nil {
*out = nil
} else {
*out = new(v1.LabelSelector) *out = new(v1.LabelSelector)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
in.Template.DeepCopyInto(&out.Template) in.Template.DeepCopyInto(&out.Template)
return return
} }
@@ -589,13 +541,9 @@ func (in *RollingUpdateDaemonSet) DeepCopyInto(out *RollingUpdateDaemonSet) {
*out = *in *out = *in
if in.MaxUnavailable != nil { if in.MaxUnavailable != nil {
in, out := &in.MaxUnavailable, &out.MaxUnavailable in, out := &in.MaxUnavailable, &out.MaxUnavailable
if *in == nil {
*out = nil
} else {
*out = new(intstr.IntOrString) *out = new(intstr.IntOrString)
**out = **in **out = **in
} }
}
return return
} }
@@ -614,22 +562,14 @@ func (in *RollingUpdateDeployment) DeepCopyInto(out *RollingUpdateDeployment) {
*out = *in *out = *in
if in.MaxUnavailable != nil { if in.MaxUnavailable != nil {
in, out := &in.MaxUnavailable, &out.MaxUnavailable in, out := &in.MaxUnavailable, &out.MaxUnavailable
if *in == nil {
*out = nil
} else {
*out = new(intstr.IntOrString) *out = new(intstr.IntOrString)
**out = **in **out = **in
} }
}
if in.MaxSurge != nil { if in.MaxSurge != nil {
in, out := &in.MaxSurge, &out.MaxSurge in, out := &in.MaxSurge, &out.MaxSurge
if *in == nil {
*out = nil
} else {
*out = new(intstr.IntOrString) *out = new(intstr.IntOrString)
**out = **in **out = **in
} }
}
return return
} }
@@ -648,13 +588,9 @@ func (in *RollingUpdateStatefulSetStrategy) DeepCopyInto(out *RollingUpdateState
*out = *in *out = *in
if in.Partition != nil { if in.Partition != nil {
in, out := &in.Partition, &out.Partition in, out := &in.Partition, &out.Partition
if *in == nil {
*out = nil
} else {
*out = new(int32) *out = new(int32)
**out = **in **out = **in
} }
}
return return
} }
@@ -818,22 +754,14 @@ func (in *StatefulSetSpec) DeepCopyInto(out *StatefulSetSpec) {
*out = *in *out = *in
if in.Replicas != nil { if in.Replicas != nil {
in, out := &in.Replicas, &out.Replicas in, out := &in.Replicas, &out.Replicas
if *in == nil {
*out = nil
} else {
*out = new(int32) *out = new(int32)
**out = **in **out = **in
} }
}
if in.Selector != nil { if in.Selector != nil {
in, out := &in.Selector, &out.Selector in, out := &in.Selector, &out.Selector
if *in == nil {
*out = nil
} else {
*out = new(v1.LabelSelector) *out = new(v1.LabelSelector)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
in.Template.DeepCopyInto(&out.Template) in.Template.DeepCopyInto(&out.Template)
if in.VolumeClaimTemplates != nil { if in.VolumeClaimTemplates != nil {
in, out := &in.VolumeClaimTemplates, &out.VolumeClaimTemplates in, out := &in.VolumeClaimTemplates, &out.VolumeClaimTemplates
@@ -845,13 +773,9 @@ func (in *StatefulSetSpec) DeepCopyInto(out *StatefulSetSpec) {
in.UpdateStrategy.DeepCopyInto(&out.UpdateStrategy) in.UpdateStrategy.DeepCopyInto(&out.UpdateStrategy)
if in.RevisionHistoryLimit != nil { if in.RevisionHistoryLimit != nil {
in, out := &in.RevisionHistoryLimit, &out.RevisionHistoryLimit in, out := &in.RevisionHistoryLimit, &out.RevisionHistoryLimit
if *in == nil {
*out = nil
} else {
*out = new(int32) *out = new(int32)
**out = **in **out = **in
} }
}
return return
} }
@@ -870,13 +794,9 @@ func (in *StatefulSetStatus) DeepCopyInto(out *StatefulSetStatus) {
*out = *in *out = *in
if in.CollisionCount != nil { if in.CollisionCount != nil {
in, out := &in.CollisionCount, &out.CollisionCount in, out := &in.CollisionCount, &out.CollisionCount
if *in == nil {
*out = nil
} else {
*out = new(int32) *out = new(int32)
**out = **in **out = **in
} }
}
if in.Conditions != nil { if in.Conditions != nil {
in, out := &in.Conditions, &out.Conditions in, out := &in.Conditions, &out.Conditions
*out = make([]StatefulSetCondition, len(*in)) *out = make([]StatefulSetCondition, len(*in))
@@ -902,13 +822,9 @@ func (in *StatefulSetUpdateStrategy) DeepCopyInto(out *StatefulSetUpdateStrategy
*out = *in *out = *in
if in.RollingUpdate != nil { if in.RollingUpdate != nil {
in, out := &in.RollingUpdate, &out.RollingUpdate in, out := &in.RollingUpdate, &out.RollingUpdate
if *in == nil {
*out = nil
} else {
*out = new(RollingUpdateStatefulSetStrategy) *out = new(RollingUpdateStatefulSetStrategy)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
return return
} }
+5 -10
View File
@@ -98,22 +98,14 @@ func (in *TokenRequestSpec) DeepCopyInto(out *TokenRequestSpec) {
} }
if in.ExpirationSeconds != nil { if in.ExpirationSeconds != nil {
in, out := &in.ExpirationSeconds, &out.ExpirationSeconds in, out := &in.ExpirationSeconds, &out.ExpirationSeconds
if *in == nil {
*out = nil
} else {
*out = new(int64) *out = new(int64)
**out = **in **out = **in
} }
}
if in.BoundObjectRef != nil { if in.BoundObjectRef != nil {
in, out := &in.BoundObjectRef, &out.BoundObjectRef in, out := &in.BoundObjectRef, &out.BoundObjectRef
if *in == nil {
*out = nil
} else {
*out = new(BoundObjectReference) *out = new(BoundObjectReference)
**out = **in **out = **in
} }
}
return return
} }
@@ -217,12 +209,15 @@ func (in *UserInfo) DeepCopyInto(out *UserInfo) {
in, out := &in.Extra, &out.Extra in, out := &in.Extra, &out.Extra
*out = make(map[string]ExtraValue, len(*in)) *out = make(map[string]ExtraValue, len(*in))
for key, val := range *in { for key, val := range *in {
var outVal []string
if val == nil { if val == nil {
(*out)[key] = nil (*out)[key] = nil
} else { } else {
(*out)[key] = make([]string, len(val)) in, out := &val, &outVal
copy((*out)[key], val) *out = make(ExtraValue, len(*in))
copy(*out, *in)
} }
(*out)[key] = outVal
} }
} }
return return
+5 -2
View File
@@ -117,12 +117,15 @@ func (in *UserInfo) DeepCopyInto(out *UserInfo) {
in, out := &in.Extra, &out.Extra in, out := &in.Extra, &out.Extra
*out = make(map[string]ExtraValue, len(*in)) *out = make(map[string]ExtraValue, len(*in))
for key, val := range *in { for key, val := range *in {
var outVal []string
if val == nil { if val == nil {
(*out)[key] = nil (*out)[key] = nil
} else { } else {
(*out)[key] = make([]string, len(val)) in, out := &val, &outVal
copy((*out)[key], val) *out = make(ExtraValue, len(*in))
copy(*out, *in)
} }
(*out)[key] = outVal
} }
} }
return return
+5 -18
View File
@@ -199,22 +199,14 @@ func (in *SelfSubjectAccessReviewSpec) DeepCopyInto(out *SelfSubjectAccessReview
*out = *in *out = *in
if in.ResourceAttributes != nil { if in.ResourceAttributes != nil {
in, out := &in.ResourceAttributes, &out.ResourceAttributes in, out := &in.ResourceAttributes, &out.ResourceAttributes
if *in == nil {
*out = nil
} else {
*out = new(ResourceAttributes) *out = new(ResourceAttributes)
**out = **in **out = **in
} }
}
if in.NonResourceAttributes != nil { if in.NonResourceAttributes != nil {
in, out := &in.NonResourceAttributes, &out.NonResourceAttributes in, out := &in.NonResourceAttributes, &out.NonResourceAttributes
if *in == nil {
*out = nil
} else {
*out = new(NonResourceAttributes) *out = new(NonResourceAttributes)
**out = **in **out = **in
} }
}
return return
} }
@@ -305,22 +297,14 @@ func (in *SubjectAccessReviewSpec) DeepCopyInto(out *SubjectAccessReviewSpec) {
*out = *in *out = *in
if in.ResourceAttributes != nil { if in.ResourceAttributes != nil {
in, out := &in.ResourceAttributes, &out.ResourceAttributes in, out := &in.ResourceAttributes, &out.ResourceAttributes
if *in == nil {
*out = nil
} else {
*out = new(ResourceAttributes) *out = new(ResourceAttributes)
**out = **in **out = **in
} }
}
if in.NonResourceAttributes != nil { if in.NonResourceAttributes != nil {
in, out := &in.NonResourceAttributes, &out.NonResourceAttributes in, out := &in.NonResourceAttributes, &out.NonResourceAttributes
if *in == nil {
*out = nil
} else {
*out = new(NonResourceAttributes) *out = new(NonResourceAttributes)
**out = **in **out = **in
} }
}
if in.Groups != nil { if in.Groups != nil {
in, out := &in.Groups, &out.Groups in, out := &in.Groups, &out.Groups
*out = make([]string, len(*in)) *out = make([]string, len(*in))
@@ -330,12 +314,15 @@ func (in *SubjectAccessReviewSpec) DeepCopyInto(out *SubjectAccessReviewSpec) {
in, out := &in.Extra, &out.Extra in, out := &in.Extra, &out.Extra
*out = make(map[string]ExtraValue, len(*in)) *out = make(map[string]ExtraValue, len(*in))
for key, val := range *in { for key, val := range *in {
var outVal []string
if val == nil { if val == nil {
(*out)[key] = nil (*out)[key] = nil
} else { } else {
(*out)[key] = make([]string, len(val)) in, out := &val, &outVal
copy((*out)[key], val) *out = make(ExtraValue, len(*in))
copy(*out, *in)
} }
(*out)[key] = outVal
} }
} }
return return
+5 -18
View File
@@ -199,22 +199,14 @@ func (in *SelfSubjectAccessReviewSpec) DeepCopyInto(out *SelfSubjectAccessReview
*out = *in *out = *in
if in.ResourceAttributes != nil { if in.ResourceAttributes != nil {
in, out := &in.ResourceAttributes, &out.ResourceAttributes in, out := &in.ResourceAttributes, &out.ResourceAttributes
if *in == nil {
*out = nil
} else {
*out = new(ResourceAttributes) *out = new(ResourceAttributes)
**out = **in **out = **in
} }
}
if in.NonResourceAttributes != nil { if in.NonResourceAttributes != nil {
in, out := &in.NonResourceAttributes, &out.NonResourceAttributes in, out := &in.NonResourceAttributes, &out.NonResourceAttributes
if *in == nil {
*out = nil
} else {
*out = new(NonResourceAttributes) *out = new(NonResourceAttributes)
**out = **in **out = **in
} }
}
return return
} }
@@ -305,22 +297,14 @@ func (in *SubjectAccessReviewSpec) DeepCopyInto(out *SubjectAccessReviewSpec) {
*out = *in *out = *in
if in.ResourceAttributes != nil { if in.ResourceAttributes != nil {
in, out := &in.ResourceAttributes, &out.ResourceAttributes in, out := &in.ResourceAttributes, &out.ResourceAttributes
if *in == nil {
*out = nil
} else {
*out = new(ResourceAttributes) *out = new(ResourceAttributes)
**out = **in **out = **in
} }
}
if in.NonResourceAttributes != nil { if in.NonResourceAttributes != nil {
in, out := &in.NonResourceAttributes, &out.NonResourceAttributes in, out := &in.NonResourceAttributes, &out.NonResourceAttributes
if *in == nil {
*out = nil
} else {
*out = new(NonResourceAttributes) *out = new(NonResourceAttributes)
**out = **in **out = **in
} }
}
if in.Groups != nil { if in.Groups != nil {
in, out := &in.Groups, &out.Groups in, out := &in.Groups, &out.Groups
*out = make([]string, len(*in)) *out = make([]string, len(*in))
@@ -330,12 +314,15 @@ func (in *SubjectAccessReviewSpec) DeepCopyInto(out *SubjectAccessReviewSpec) {
in, out := &in.Extra, &out.Extra in, out := &in.Extra, &out.Extra
*out = make(map[string]ExtraValue, len(*in)) *out = make(map[string]ExtraValue, len(*in))
for key, val := range *in { for key, val := range *in {
var outVal []string
if val == nil { if val == nil {
(*out)[key] = nil (*out)[key] = nil
} else { } else {
(*out)[key] = make([]string, len(val)) in, out := &val, &outVal
copy((*out)[key], val) *out = make(ExtraValue, len(*in))
copy(*out, *in)
} }
(*out)[key] = outVal
} }
} }
return return
-84
View File
@@ -46,31 +46,19 @@ func (in *ExternalMetricSource) DeepCopyInto(out *ExternalMetricSource) {
*out = *in *out = *in
if in.MetricSelector != nil { if in.MetricSelector != nil {
in, out := &in.MetricSelector, &out.MetricSelector in, out := &in.MetricSelector, &out.MetricSelector
if *in == nil {
*out = nil
} else {
*out = new(meta_v1.LabelSelector) *out = new(meta_v1.LabelSelector)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
if in.TargetValue != nil { if in.TargetValue != nil {
in, out := &in.TargetValue, &out.TargetValue in, out := &in.TargetValue, &out.TargetValue
if *in == nil {
*out = nil
} else {
x := (*in).DeepCopy() x := (*in).DeepCopy()
*out = &x *out = &x
} }
}
if in.TargetAverageValue != nil { if in.TargetAverageValue != nil {
in, out := &in.TargetAverageValue, &out.TargetAverageValue in, out := &in.TargetAverageValue, &out.TargetAverageValue
if *in == nil {
*out = nil
} else {
x := (*in).DeepCopy() x := (*in).DeepCopy()
*out = &x *out = &x
} }
}
return return
} }
@@ -89,23 +77,15 @@ func (in *ExternalMetricStatus) DeepCopyInto(out *ExternalMetricStatus) {
*out = *in *out = *in
if in.MetricSelector != nil { if in.MetricSelector != nil {
in, out := &in.MetricSelector, &out.MetricSelector in, out := &in.MetricSelector, &out.MetricSelector
if *in == nil {
*out = nil
} else {
*out = new(meta_v1.LabelSelector) *out = new(meta_v1.LabelSelector)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
out.CurrentValue = in.CurrentValue.DeepCopy() out.CurrentValue = in.CurrentValue.DeepCopy()
if in.CurrentAverageValue != nil { if in.CurrentAverageValue != nil {
in, out := &in.CurrentAverageValue, &out.CurrentAverageValue in, out := &in.CurrentAverageValue, &out.CurrentAverageValue
if *in == nil {
*out = nil
} else {
x := (*in).DeepCopy() x := (*in).DeepCopy()
*out = &x *out = &x
} }
}
return return
} }
@@ -203,22 +183,14 @@ func (in *HorizontalPodAutoscalerSpec) DeepCopyInto(out *HorizontalPodAutoscaler
out.ScaleTargetRef = in.ScaleTargetRef out.ScaleTargetRef = in.ScaleTargetRef
if in.MinReplicas != nil { if in.MinReplicas != nil {
in, out := &in.MinReplicas, &out.MinReplicas in, out := &in.MinReplicas, &out.MinReplicas
if *in == nil {
*out = nil
} else {
*out = new(int32) *out = new(int32)
**out = **in **out = **in
} }
}
if in.TargetCPUUtilizationPercentage != nil { if in.TargetCPUUtilizationPercentage != nil {
in, out := &in.TargetCPUUtilizationPercentage, &out.TargetCPUUtilizationPercentage in, out := &in.TargetCPUUtilizationPercentage, &out.TargetCPUUtilizationPercentage
if *in == nil {
*out = nil
} else {
*out = new(int32) *out = new(int32)
**out = **in **out = **in
} }
}
return return
} }
@@ -237,30 +209,18 @@ func (in *HorizontalPodAutoscalerStatus) DeepCopyInto(out *HorizontalPodAutoscal
*out = *in *out = *in
if in.ObservedGeneration != nil { if in.ObservedGeneration != nil {
in, out := &in.ObservedGeneration, &out.ObservedGeneration in, out := &in.ObservedGeneration, &out.ObservedGeneration
if *in == nil {
*out = nil
} else {
*out = new(int64) *out = new(int64)
**out = **in **out = **in
} }
}
if in.LastScaleTime != nil { if in.LastScaleTime != nil {
in, out := &in.LastScaleTime, &out.LastScaleTime in, out := &in.LastScaleTime, &out.LastScaleTime
if *in == nil {
*out = nil
} else {
*out = (*in).DeepCopy() *out = (*in).DeepCopy()
} }
}
if in.CurrentCPUUtilizationPercentage != nil { if in.CurrentCPUUtilizationPercentage != nil {
in, out := &in.CurrentCPUUtilizationPercentage, &out.CurrentCPUUtilizationPercentage in, out := &in.CurrentCPUUtilizationPercentage, &out.CurrentCPUUtilizationPercentage
if *in == nil {
*out = nil
} else {
*out = new(int32) *out = new(int32)
**out = **in **out = **in
} }
}
return return
} }
@@ -279,40 +239,24 @@ func (in *MetricSpec) DeepCopyInto(out *MetricSpec) {
*out = *in *out = *in
if in.Object != nil { if in.Object != nil {
in, out := &in.Object, &out.Object in, out := &in.Object, &out.Object
if *in == nil {
*out = nil
} else {
*out = new(ObjectMetricSource) *out = new(ObjectMetricSource)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
if in.Pods != nil { if in.Pods != nil {
in, out := &in.Pods, &out.Pods in, out := &in.Pods, &out.Pods
if *in == nil {
*out = nil
} else {
*out = new(PodsMetricSource) *out = new(PodsMetricSource)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
if in.Resource != nil { if in.Resource != nil {
in, out := &in.Resource, &out.Resource in, out := &in.Resource, &out.Resource
if *in == nil {
*out = nil
} else {
*out = new(ResourceMetricSource) *out = new(ResourceMetricSource)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
if in.External != nil { if in.External != nil {
in, out := &in.External, &out.External in, out := &in.External, &out.External
if *in == nil {
*out = nil
} else {
*out = new(ExternalMetricSource) *out = new(ExternalMetricSource)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
return return
} }
@@ -331,40 +275,24 @@ func (in *MetricStatus) DeepCopyInto(out *MetricStatus) {
*out = *in *out = *in
if in.Object != nil { if in.Object != nil {
in, out := &in.Object, &out.Object in, out := &in.Object, &out.Object
if *in == nil {
*out = nil
} else {
*out = new(ObjectMetricStatus) *out = new(ObjectMetricStatus)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
if in.Pods != nil { if in.Pods != nil {
in, out := &in.Pods, &out.Pods in, out := &in.Pods, &out.Pods
if *in == nil {
*out = nil
} else {
*out = new(PodsMetricStatus) *out = new(PodsMetricStatus)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
if in.Resource != nil { if in.Resource != nil {
in, out := &in.Resource, &out.Resource in, out := &in.Resource, &out.Resource
if *in == nil {
*out = nil
} else {
*out = new(ResourceMetricStatus) *out = new(ResourceMetricStatus)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
if in.External != nil { if in.External != nil {
in, out := &in.External, &out.External in, out := &in.External, &out.External
if *in == nil {
*out = nil
} else {
*out = new(ExternalMetricStatus) *out = new(ExternalMetricStatus)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
return return
} }
@@ -453,22 +381,14 @@ func (in *ResourceMetricSource) DeepCopyInto(out *ResourceMetricSource) {
*out = *in *out = *in
if in.TargetAverageUtilization != nil { if in.TargetAverageUtilization != nil {
in, out := &in.TargetAverageUtilization, &out.TargetAverageUtilization in, out := &in.TargetAverageUtilization, &out.TargetAverageUtilization
if *in == nil {
*out = nil
} else {
*out = new(int32) *out = new(int32)
**out = **in **out = **in
} }
}
if in.TargetAverageValue != nil { if in.TargetAverageValue != nil {
in, out := &in.TargetAverageValue, &out.TargetAverageValue in, out := &in.TargetAverageValue, &out.TargetAverageValue
if *in == nil {
*out = nil
} else {
x := (*in).DeepCopy() x := (*in).DeepCopy()
*out = &x *out = &x
} }
}
return return
} }
@@ -487,13 +407,9 @@ func (in *ResourceMetricStatus) DeepCopyInto(out *ResourceMetricStatus) {
*out = *in *out = *in
if in.CurrentAverageUtilization != nil { if in.CurrentAverageUtilization != nil {
in, out := &in.CurrentAverageUtilization, &out.CurrentAverageUtilization in, out := &in.CurrentAverageUtilization, &out.CurrentAverageUtilization
if *in == nil {
*out = nil
} else {
*out = new(int32) *out = new(int32)
**out = **in **out = **in
} }
}
out.CurrentAverageValue = in.CurrentAverageValue.DeepCopy() out.CurrentAverageValue = in.CurrentAverageValue.DeepCopy()
return return
} }
-76
View File
@@ -46,31 +46,19 @@ func (in *ExternalMetricSource) DeepCopyInto(out *ExternalMetricSource) {
*out = *in *out = *in
if in.MetricSelector != nil { if in.MetricSelector != nil {
in, out := &in.MetricSelector, &out.MetricSelector in, out := &in.MetricSelector, &out.MetricSelector
if *in == nil {
*out = nil
} else {
*out = new(v1.LabelSelector) *out = new(v1.LabelSelector)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
if in.TargetValue != nil { if in.TargetValue != nil {
in, out := &in.TargetValue, &out.TargetValue in, out := &in.TargetValue, &out.TargetValue
if *in == nil {
*out = nil
} else {
x := (*in).DeepCopy() x := (*in).DeepCopy()
*out = &x *out = &x
} }
}
if in.TargetAverageValue != nil { if in.TargetAverageValue != nil {
in, out := &in.TargetAverageValue, &out.TargetAverageValue in, out := &in.TargetAverageValue, &out.TargetAverageValue
if *in == nil {
*out = nil
} else {
x := (*in).DeepCopy() x := (*in).DeepCopy()
*out = &x *out = &x
} }
}
return return
} }
@@ -89,23 +77,15 @@ func (in *ExternalMetricStatus) DeepCopyInto(out *ExternalMetricStatus) {
*out = *in *out = *in
if in.MetricSelector != nil { if in.MetricSelector != nil {
in, out := &in.MetricSelector, &out.MetricSelector in, out := &in.MetricSelector, &out.MetricSelector
if *in == nil {
*out = nil
} else {
*out = new(v1.LabelSelector) *out = new(v1.LabelSelector)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
out.CurrentValue = in.CurrentValue.DeepCopy() out.CurrentValue = in.CurrentValue.DeepCopy()
if in.CurrentAverageValue != nil { if in.CurrentAverageValue != nil {
in, out := &in.CurrentAverageValue, &out.CurrentAverageValue in, out := &in.CurrentAverageValue, &out.CurrentAverageValue
if *in == nil {
*out = nil
} else {
x := (*in).DeepCopy() x := (*in).DeepCopy()
*out = &x *out = &x
} }
}
return return
} }
@@ -203,13 +183,9 @@ func (in *HorizontalPodAutoscalerSpec) DeepCopyInto(out *HorizontalPodAutoscaler
out.ScaleTargetRef = in.ScaleTargetRef out.ScaleTargetRef = in.ScaleTargetRef
if in.MinReplicas != nil { if in.MinReplicas != nil {
in, out := &in.MinReplicas, &out.MinReplicas in, out := &in.MinReplicas, &out.MinReplicas
if *in == nil {
*out = nil
} else {
*out = new(int32) *out = new(int32)
**out = **in **out = **in
} }
}
if in.Metrics != nil { if in.Metrics != nil {
in, out := &in.Metrics, &out.Metrics in, out := &in.Metrics, &out.Metrics
*out = make([]MetricSpec, len(*in)) *out = make([]MetricSpec, len(*in))
@@ -235,21 +211,13 @@ func (in *HorizontalPodAutoscalerStatus) DeepCopyInto(out *HorizontalPodAutoscal
*out = *in *out = *in
if in.ObservedGeneration != nil { if in.ObservedGeneration != nil {
in, out := &in.ObservedGeneration, &out.ObservedGeneration in, out := &in.ObservedGeneration, &out.ObservedGeneration
if *in == nil {
*out = nil
} else {
*out = new(int64) *out = new(int64)
**out = **in **out = **in
} }
}
if in.LastScaleTime != nil { if in.LastScaleTime != nil {
in, out := &in.LastScaleTime, &out.LastScaleTime in, out := &in.LastScaleTime, &out.LastScaleTime
if *in == nil {
*out = nil
} else {
*out = (*in).DeepCopy() *out = (*in).DeepCopy()
} }
}
if in.CurrentMetrics != nil { if in.CurrentMetrics != nil {
in, out := &in.CurrentMetrics, &out.CurrentMetrics in, out := &in.CurrentMetrics, &out.CurrentMetrics
*out = make([]MetricStatus, len(*in)) *out = make([]MetricStatus, len(*in))
@@ -282,40 +250,24 @@ func (in *MetricSpec) DeepCopyInto(out *MetricSpec) {
*out = *in *out = *in
if in.Object != nil { if in.Object != nil {
in, out := &in.Object, &out.Object in, out := &in.Object, &out.Object
if *in == nil {
*out = nil
} else {
*out = new(ObjectMetricSource) *out = new(ObjectMetricSource)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
if in.Pods != nil { if in.Pods != nil {
in, out := &in.Pods, &out.Pods in, out := &in.Pods, &out.Pods
if *in == nil {
*out = nil
} else {
*out = new(PodsMetricSource) *out = new(PodsMetricSource)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
if in.Resource != nil { if in.Resource != nil {
in, out := &in.Resource, &out.Resource in, out := &in.Resource, &out.Resource
if *in == nil {
*out = nil
} else {
*out = new(ResourceMetricSource) *out = new(ResourceMetricSource)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
if in.External != nil { if in.External != nil {
in, out := &in.External, &out.External in, out := &in.External, &out.External
if *in == nil {
*out = nil
} else {
*out = new(ExternalMetricSource) *out = new(ExternalMetricSource)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
return return
} }
@@ -334,40 +286,24 @@ func (in *MetricStatus) DeepCopyInto(out *MetricStatus) {
*out = *in *out = *in
if in.Object != nil { if in.Object != nil {
in, out := &in.Object, &out.Object in, out := &in.Object, &out.Object
if *in == nil {
*out = nil
} else {
*out = new(ObjectMetricStatus) *out = new(ObjectMetricStatus)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
if in.Pods != nil { if in.Pods != nil {
in, out := &in.Pods, &out.Pods in, out := &in.Pods, &out.Pods
if *in == nil {
*out = nil
} else {
*out = new(PodsMetricStatus) *out = new(PodsMetricStatus)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
if in.Resource != nil { if in.Resource != nil {
in, out := &in.Resource, &out.Resource in, out := &in.Resource, &out.Resource
if *in == nil {
*out = nil
} else {
*out = new(ResourceMetricStatus) *out = new(ResourceMetricStatus)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
if in.External != nil { if in.External != nil {
in, out := &in.External, &out.External in, out := &in.External, &out.External
if *in == nil {
*out = nil
} else {
*out = new(ExternalMetricStatus) *out = new(ExternalMetricStatus)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
return return
} }
@@ -456,22 +392,14 @@ func (in *ResourceMetricSource) DeepCopyInto(out *ResourceMetricSource) {
*out = *in *out = *in
if in.TargetAverageUtilization != nil { if in.TargetAverageUtilization != nil {
in, out := &in.TargetAverageUtilization, &out.TargetAverageUtilization in, out := &in.TargetAverageUtilization, &out.TargetAverageUtilization
if *in == nil {
*out = nil
} else {
*out = new(int32) *out = new(int32)
**out = **in **out = **in
} }
}
if in.TargetAverageValue != nil { if in.TargetAverageValue != nil {
in, out := &in.TargetAverageValue, &out.TargetAverageValue in, out := &in.TargetAverageValue, &out.TargetAverageValue
if *in == nil {
*out = nil
} else {
x := (*in).DeepCopy() x := (*in).DeepCopy()
*out = &x *out = &x
} }
}
return return
} }
@@ -490,13 +418,9 @@ func (in *ResourceMetricStatus) DeepCopyInto(out *ResourceMetricStatus) {
*out = *in *out = *in
if in.CurrentAverageUtilization != nil { if in.CurrentAverageUtilization != nil {
in, out := &in.CurrentAverageUtilization, &out.CurrentAverageUtilization in, out := &in.CurrentAverageUtilization, &out.CurrentAverageUtilization
if *in == nil {
*out = nil
} else {
*out = new(int32) *out = new(int32)
**out = **in **out = **in
} }
}
out.CurrentAverageValue = in.CurrentAverageValue.DeepCopy() out.CurrentAverageValue = in.CurrentAverageValue.DeepCopy()
return return
} }
-32
View File
@@ -109,58 +109,34 @@ func (in *JobSpec) DeepCopyInto(out *JobSpec) {
*out = *in *out = *in
if in.Parallelism != nil { if in.Parallelism != nil {
in, out := &in.Parallelism, &out.Parallelism in, out := &in.Parallelism, &out.Parallelism
if *in == nil {
*out = nil
} else {
*out = new(int32) *out = new(int32)
**out = **in **out = **in
} }
}
if in.Completions != nil { if in.Completions != nil {
in, out := &in.Completions, &out.Completions in, out := &in.Completions, &out.Completions
if *in == nil {
*out = nil
} else {
*out = new(int32) *out = new(int32)
**out = **in **out = **in
} }
}
if in.ActiveDeadlineSeconds != nil { if in.ActiveDeadlineSeconds != nil {
in, out := &in.ActiveDeadlineSeconds, &out.ActiveDeadlineSeconds in, out := &in.ActiveDeadlineSeconds, &out.ActiveDeadlineSeconds
if *in == nil {
*out = nil
} else {
*out = new(int64) *out = new(int64)
**out = **in **out = **in
} }
}
if in.BackoffLimit != nil { if in.BackoffLimit != nil {
in, out := &in.BackoffLimit, &out.BackoffLimit in, out := &in.BackoffLimit, &out.BackoffLimit
if *in == nil {
*out = nil
} else {
*out = new(int32) *out = new(int32)
**out = **in **out = **in
} }
}
if in.Selector != nil { if in.Selector != nil {
in, out := &in.Selector, &out.Selector in, out := &in.Selector, &out.Selector
if *in == nil {
*out = nil
} else {
*out = new(meta_v1.LabelSelector) *out = new(meta_v1.LabelSelector)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
if in.ManualSelector != nil { if in.ManualSelector != nil {
in, out := &in.ManualSelector, &out.ManualSelector in, out := &in.ManualSelector, &out.ManualSelector
if *in == nil {
*out = nil
} else {
*out = new(bool) *out = new(bool)
**out = **in **out = **in
} }
}
in.Template.DeepCopyInto(&out.Template) in.Template.DeepCopyInto(&out.Template)
return return
} }
@@ -187,20 +163,12 @@ func (in *JobStatus) DeepCopyInto(out *JobStatus) {
} }
if in.StartTime != nil { if in.StartTime != nil {
in, out := &in.StartTime, &out.StartTime in, out := &in.StartTime, &out.StartTime
if *in == nil {
*out = nil
} else {
*out = (*in).DeepCopy() *out = (*in).DeepCopy()
} }
}
if in.CompletionTime != nil { if in.CompletionTime != nil {
in, out := &in.CompletionTime, &out.CompletionTime in, out := &in.CompletionTime, &out.CompletionTime
if *in == nil {
*out = nil
} else {
*out = (*in).DeepCopy() *out = (*in).DeepCopy()
} }
}
return return
} }
-20
View File
@@ -91,41 +91,25 @@ func (in *CronJobSpec) DeepCopyInto(out *CronJobSpec) {
*out = *in *out = *in
if in.StartingDeadlineSeconds != nil { if in.StartingDeadlineSeconds != nil {
in, out := &in.StartingDeadlineSeconds, &out.StartingDeadlineSeconds in, out := &in.StartingDeadlineSeconds, &out.StartingDeadlineSeconds
if *in == nil {
*out = nil
} else {
*out = new(int64) *out = new(int64)
**out = **in **out = **in
} }
}
if in.Suspend != nil { if in.Suspend != nil {
in, out := &in.Suspend, &out.Suspend in, out := &in.Suspend, &out.Suspend
if *in == nil {
*out = nil
} else {
*out = new(bool) *out = new(bool)
**out = **in **out = **in
} }
}
in.JobTemplate.DeepCopyInto(&out.JobTemplate) in.JobTemplate.DeepCopyInto(&out.JobTemplate)
if in.SuccessfulJobsHistoryLimit != nil { if in.SuccessfulJobsHistoryLimit != nil {
in, out := &in.SuccessfulJobsHistoryLimit, &out.SuccessfulJobsHistoryLimit in, out := &in.SuccessfulJobsHistoryLimit, &out.SuccessfulJobsHistoryLimit
if *in == nil {
*out = nil
} else {
*out = new(int32) *out = new(int32)
**out = **in **out = **in
} }
}
if in.FailedJobsHistoryLimit != nil { if in.FailedJobsHistoryLimit != nil {
in, out := &in.FailedJobsHistoryLimit, &out.FailedJobsHistoryLimit in, out := &in.FailedJobsHistoryLimit, &out.FailedJobsHistoryLimit
if *in == nil {
*out = nil
} else {
*out = new(int32) *out = new(int32)
**out = **in **out = **in
} }
}
return return
} }
@@ -149,12 +133,8 @@ func (in *CronJobStatus) DeepCopyInto(out *CronJobStatus) {
} }
if in.LastScheduleTime != nil { if in.LastScheduleTime != nil {
in, out := &in.LastScheduleTime, &out.LastScheduleTime in, out := &in.LastScheduleTime, &out.LastScheduleTime
if *in == nil {
*out = nil
} else {
*out = (*in).DeepCopy() *out = (*in).DeepCopy()
} }
}
return return
} }
-20
View File
@@ -91,41 +91,25 @@ func (in *CronJobSpec) DeepCopyInto(out *CronJobSpec) {
*out = *in *out = *in
if in.StartingDeadlineSeconds != nil { if in.StartingDeadlineSeconds != nil {
in, out := &in.StartingDeadlineSeconds, &out.StartingDeadlineSeconds in, out := &in.StartingDeadlineSeconds, &out.StartingDeadlineSeconds
if *in == nil {
*out = nil
} else {
*out = new(int64) *out = new(int64)
**out = **in **out = **in
} }
}
if in.Suspend != nil { if in.Suspend != nil {
in, out := &in.Suspend, &out.Suspend in, out := &in.Suspend, &out.Suspend
if *in == nil {
*out = nil
} else {
*out = new(bool) *out = new(bool)
**out = **in **out = **in
} }
}
in.JobTemplate.DeepCopyInto(&out.JobTemplate) in.JobTemplate.DeepCopyInto(&out.JobTemplate)
if in.SuccessfulJobsHistoryLimit != nil { if in.SuccessfulJobsHistoryLimit != nil {
in, out := &in.SuccessfulJobsHistoryLimit, &out.SuccessfulJobsHistoryLimit in, out := &in.SuccessfulJobsHistoryLimit, &out.SuccessfulJobsHistoryLimit
if *in == nil {
*out = nil
} else {
*out = new(int32) *out = new(int32)
**out = **in **out = **in
} }
}
if in.FailedJobsHistoryLimit != nil { if in.FailedJobsHistoryLimit != nil {
in, out := &in.FailedJobsHistoryLimit, &out.FailedJobsHistoryLimit in, out := &in.FailedJobsHistoryLimit, &out.FailedJobsHistoryLimit
if *in == nil {
*out = nil
} else {
*out = new(int32) *out = new(int32)
**out = **in **out = **in
} }
}
return return
} }
@@ -149,12 +133,8 @@ func (in *CronJobStatus) DeepCopyInto(out *CronJobStatus) {
} }
if in.LastScheduleTime != nil { if in.LastScheduleTime != nil {
in, out := &in.LastScheduleTime, &out.LastScheduleTime in, out := &in.LastScheduleTime, &out.LastScheduleTime
if *in == nil {
*out = nil
} else {
*out = (*in).DeepCopy() *out = (*in).DeepCopy()
} }
}
return return
} }
+5 -2
View File
@@ -124,12 +124,15 @@ func (in *CertificateSigningRequestSpec) DeepCopyInto(out *CertificateSigningReq
in, out := &in.Extra, &out.Extra in, out := &in.Extra, &out.Extra
*out = make(map[string]ExtraValue, len(*in)) *out = make(map[string]ExtraValue, len(*in))
for key, val := range *in { for key, val := range *in {
var outVal []string
if val == nil { if val == nil {
(*out)[key] = nil (*out)[key] = nil
} else { } else {
(*out)[key] = make([]string, len(val)) in, out := &val, &outVal
copy((*out)[key], val) *out = make(ExtraValue, len(*in))
copy(*out, *in)
} }
(*out)[key] = outVal
} }
} }
return return
+10 -712
View File
File diff suppressed because it is too large Load Diff
-8
View File
@@ -33,23 +33,15 @@ func (in *Event) DeepCopyInto(out *Event) {
in.EventTime.DeepCopyInto(&out.EventTime) in.EventTime.DeepCopyInto(&out.EventTime)
if in.Series != nil { if in.Series != nil {
in, out := &in.Series, &out.Series in, out := &in.Series, &out.Series
if *in == nil {
*out = nil
} else {
*out = new(EventSeries) *out = new(EventSeries)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
out.Regarding = in.Regarding out.Regarding = in.Regarding
if in.Related != nil { if in.Related != nil {
in, out := &in.Related, &out.Related in, out := &in.Related, &out.Related
if *in == nil {
*out = nil
} else {
*out = new(v1.ObjectReference) *out = new(v1.ObjectReference)
**out = **in **out = **in
} }
}
out.DeprecatedSource = in.DeprecatedSource out.DeprecatedSource = in.DeprecatedSource
in.DeprecatedFirstTimestamp.DeepCopyInto(&out.DeprecatedFirstTimestamp) in.DeprecatedFirstTimestamp.DeepCopyInto(&out.DeprecatedFirstTimestamp)
in.DeprecatedLastTimestamp.DeepCopyInto(&out.DeprecatedLastTimestamp) in.DeprecatedLastTimestamp.DeepCopyInto(&out.DeprecatedLastTimestamp)
-104
View File
@@ -222,24 +222,16 @@ func (in *DaemonSetSpec) DeepCopyInto(out *DaemonSetSpec) {
*out = *in *out = *in
if in.Selector != nil { if in.Selector != nil {
in, out := &in.Selector, &out.Selector in, out := &in.Selector, &out.Selector
if *in == nil {
*out = nil
} else {
*out = new(v1.LabelSelector) *out = new(v1.LabelSelector)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
in.Template.DeepCopyInto(&out.Template) in.Template.DeepCopyInto(&out.Template)
in.UpdateStrategy.DeepCopyInto(&out.UpdateStrategy) in.UpdateStrategy.DeepCopyInto(&out.UpdateStrategy)
if in.RevisionHistoryLimit != nil { if in.RevisionHistoryLimit != nil {
in, out := &in.RevisionHistoryLimit, &out.RevisionHistoryLimit in, out := &in.RevisionHistoryLimit, &out.RevisionHistoryLimit
if *in == nil {
*out = nil
} else {
*out = new(int32) *out = new(int32)
**out = **in **out = **in
} }
}
return return
} }
@@ -258,13 +250,9 @@ func (in *DaemonSetStatus) DeepCopyInto(out *DaemonSetStatus) {
*out = *in *out = *in
if in.CollisionCount != nil { if in.CollisionCount != nil {
in, out := &in.CollisionCount, &out.CollisionCount in, out := &in.CollisionCount, &out.CollisionCount
if *in == nil {
*out = nil
} else {
*out = new(int32) *out = new(int32)
**out = **in **out = **in
} }
}
if in.Conditions != nil { if in.Conditions != nil {
in, out := &in.Conditions, &out.Conditions in, out := &in.Conditions, &out.Conditions
*out = make([]DaemonSetCondition, len(*in)) *out = make([]DaemonSetCondition, len(*in))
@@ -290,13 +278,9 @@ func (in *DaemonSetUpdateStrategy) DeepCopyInto(out *DaemonSetUpdateStrategy) {
*out = *in *out = *in
if in.RollingUpdate != nil { if in.RollingUpdate != nil {
in, out := &in.RollingUpdate, &out.RollingUpdate in, out := &in.RollingUpdate, &out.RollingUpdate
if *in == nil {
*out = nil
} else {
*out = new(RollingUpdateDaemonSet) *out = new(RollingUpdateDaemonSet)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
return return
} }
@@ -427,51 +411,31 @@ func (in *DeploymentSpec) DeepCopyInto(out *DeploymentSpec) {
*out = *in *out = *in
if in.Replicas != nil { if in.Replicas != nil {
in, out := &in.Replicas, &out.Replicas in, out := &in.Replicas, &out.Replicas
if *in == nil {
*out = nil
} else {
*out = new(int32) *out = new(int32)
**out = **in **out = **in
} }
}
if in.Selector != nil { if in.Selector != nil {
in, out := &in.Selector, &out.Selector in, out := &in.Selector, &out.Selector
if *in == nil {
*out = nil
} else {
*out = new(v1.LabelSelector) *out = new(v1.LabelSelector)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
in.Template.DeepCopyInto(&out.Template) in.Template.DeepCopyInto(&out.Template)
in.Strategy.DeepCopyInto(&out.Strategy) in.Strategy.DeepCopyInto(&out.Strategy)
if in.RevisionHistoryLimit != nil { if in.RevisionHistoryLimit != nil {
in, out := &in.RevisionHistoryLimit, &out.RevisionHistoryLimit in, out := &in.RevisionHistoryLimit, &out.RevisionHistoryLimit
if *in == nil {
*out = nil
} else {
*out = new(int32) *out = new(int32)
**out = **in **out = **in
} }
}
if in.RollbackTo != nil { if in.RollbackTo != nil {
in, out := &in.RollbackTo, &out.RollbackTo in, out := &in.RollbackTo, &out.RollbackTo
if *in == nil {
*out = nil
} else {
*out = new(RollbackConfig) *out = new(RollbackConfig)
**out = **in **out = **in
} }
}
if in.ProgressDeadlineSeconds != nil { if in.ProgressDeadlineSeconds != nil {
in, out := &in.ProgressDeadlineSeconds, &out.ProgressDeadlineSeconds in, out := &in.ProgressDeadlineSeconds, &out.ProgressDeadlineSeconds
if *in == nil {
*out = nil
} else {
*out = new(int32) *out = new(int32)
**out = **in **out = **in
} }
}
return return
} }
@@ -497,13 +461,9 @@ func (in *DeploymentStatus) DeepCopyInto(out *DeploymentStatus) {
} }
if in.CollisionCount != nil { if in.CollisionCount != nil {
in, out := &in.CollisionCount, &out.CollisionCount in, out := &in.CollisionCount, &out.CollisionCount
if *in == nil {
*out = nil
} else {
*out = new(int32) *out = new(int32)
**out = **in **out = **in
} }
}
return return
} }
@@ -522,13 +482,9 @@ func (in *DeploymentStrategy) DeepCopyInto(out *DeploymentStrategy) {
*out = *in *out = *in
if in.RollingUpdate != nil { if in.RollingUpdate != nil {
in, out := &in.RollingUpdate, &out.RollingUpdate in, out := &in.RollingUpdate, &out.RollingUpdate
if *in == nil {
*out = nil
} else {
*out = new(RollingUpdateDeployment) *out = new(RollingUpdateDeployment)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
return return
} }
@@ -754,13 +710,9 @@ func (in *IngressRuleValue) DeepCopyInto(out *IngressRuleValue) {
*out = *in *out = *in
if in.HTTP != nil { if in.HTTP != nil {
in, out := &in.HTTP, &out.HTTP in, out := &in.HTTP, &out.HTTP
if *in == nil {
*out = nil
} else {
*out = new(HTTPIngressRuleValue) *out = new(HTTPIngressRuleValue)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
return return
} }
@@ -779,13 +731,9 @@ func (in *IngressSpec) DeepCopyInto(out *IngressSpec) {
*out = *in *out = *in
if in.Backend != nil { if in.Backend != nil {
in, out := &in.Backend, &out.Backend in, out := &in.Backend, &out.Backend
if *in == nil {
*out = nil
} else {
*out = new(IngressBackend) *out = new(IngressBackend)
**out = **in **out = **in
} }
}
if in.TLS != nil { if in.TLS != nil {
in, out := &in.TLS, &out.TLS in, out := &in.TLS, &out.TLS
*out = make([]IngressTLS, len(*in)) *out = make([]IngressTLS, len(*in))
@@ -976,31 +924,19 @@ func (in *NetworkPolicyPeer) DeepCopyInto(out *NetworkPolicyPeer) {
*out = *in *out = *in
if in.PodSelector != nil { if in.PodSelector != nil {
in, out := &in.PodSelector, &out.PodSelector in, out := &in.PodSelector, &out.PodSelector
if *in == nil {
*out = nil
} else {
*out = new(v1.LabelSelector) *out = new(v1.LabelSelector)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
if in.NamespaceSelector != nil { if in.NamespaceSelector != nil {
in, out := &in.NamespaceSelector, &out.NamespaceSelector in, out := &in.NamespaceSelector, &out.NamespaceSelector
if *in == nil {
*out = nil
} else {
*out = new(v1.LabelSelector) *out = new(v1.LabelSelector)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
if in.IPBlock != nil { if in.IPBlock != nil {
in, out := &in.IPBlock, &out.IPBlock in, out := &in.IPBlock, &out.IPBlock
if *in == nil {
*out = nil
} else {
*out = new(IPBlock) *out = new(IPBlock)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
return return
} }
@@ -1019,22 +955,14 @@ func (in *NetworkPolicyPort) DeepCopyInto(out *NetworkPolicyPort) {
*out = *in *out = *in
if in.Protocol != nil { if in.Protocol != nil {
in, out := &in.Protocol, &out.Protocol in, out := &in.Protocol, &out.Protocol
if *in == nil {
*out = nil
} else {
*out = new(core_v1.Protocol) *out = new(core_v1.Protocol)
**out = **in **out = **in
} }
}
if in.Port != nil { if in.Port != nil {
in, out := &in.Port, &out.Port in, out := &in.Port, &out.Port
if *in == nil {
*out = nil
} else {
*out = new(intstr.IntOrString) *out = new(intstr.IntOrString)
**out = **in **out = **in
} }
}
return return
} }
@@ -1178,22 +1106,14 @@ func (in *PodSecurityPolicySpec) DeepCopyInto(out *PodSecurityPolicySpec) {
in.FSGroup.DeepCopyInto(&out.FSGroup) in.FSGroup.DeepCopyInto(&out.FSGroup)
if in.DefaultAllowPrivilegeEscalation != nil { if in.DefaultAllowPrivilegeEscalation != nil {
in, out := &in.DefaultAllowPrivilegeEscalation, &out.DefaultAllowPrivilegeEscalation in, out := &in.DefaultAllowPrivilegeEscalation, &out.DefaultAllowPrivilegeEscalation
if *in == nil {
*out = nil
} else {
*out = new(bool) *out = new(bool)
**out = **in **out = **in
} }
}
if in.AllowPrivilegeEscalation != nil { if in.AllowPrivilegeEscalation != nil {
in, out := &in.AllowPrivilegeEscalation, &out.AllowPrivilegeEscalation in, out := &in.AllowPrivilegeEscalation, &out.AllowPrivilegeEscalation
if *in == nil {
*out = nil
} else {
*out = new(bool) *out = new(bool)
**out = **in **out = **in
} }
}
if in.AllowedHostPaths != nil { if in.AllowedHostPaths != nil {
in, out := &in.AllowedHostPaths, &out.AllowedHostPaths in, out := &in.AllowedHostPaths, &out.AllowedHostPaths
*out = make([]AllowedHostPath, len(*in)) *out = make([]AllowedHostPath, len(*in))
@@ -1310,22 +1230,14 @@ func (in *ReplicaSetSpec) DeepCopyInto(out *ReplicaSetSpec) {
*out = *in *out = *in
if in.Replicas != nil { if in.Replicas != nil {
in, out := &in.Replicas, &out.Replicas in, out := &in.Replicas, &out.Replicas
if *in == nil {
*out = nil
} else {
*out = new(int32) *out = new(int32)
**out = **in **out = **in
} }
}
if in.Selector != nil { if in.Selector != nil {
in, out := &in.Selector, &out.Selector in, out := &in.Selector, &out.Selector
if *in == nil {
*out = nil
} else {
*out = new(v1.LabelSelector) *out = new(v1.LabelSelector)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
in.Template.DeepCopyInto(&out.Template) in.Template.DeepCopyInto(&out.Template)
return return
} }
@@ -1409,13 +1321,9 @@ func (in *RollingUpdateDaemonSet) DeepCopyInto(out *RollingUpdateDaemonSet) {
*out = *in *out = *in
if in.MaxUnavailable != nil { if in.MaxUnavailable != nil {
in, out := &in.MaxUnavailable, &out.MaxUnavailable in, out := &in.MaxUnavailable, &out.MaxUnavailable
if *in == nil {
*out = nil
} else {
*out = new(intstr.IntOrString) *out = new(intstr.IntOrString)
**out = **in **out = **in
} }
}
return return
} }
@@ -1434,22 +1342,14 @@ func (in *RollingUpdateDeployment) DeepCopyInto(out *RollingUpdateDeployment) {
*out = *in *out = *in
if in.MaxUnavailable != nil { if in.MaxUnavailable != nil {
in, out := &in.MaxUnavailable, &out.MaxUnavailable in, out := &in.MaxUnavailable, &out.MaxUnavailable
if *in == nil {
*out = nil
} else {
*out = new(intstr.IntOrString) *out = new(intstr.IntOrString)
**out = **in **out = **in
} }
}
if in.MaxSurge != nil { if in.MaxSurge != nil {
in, out := &in.MaxSurge, &out.MaxSurge in, out := &in.MaxSurge, &out.MaxSurge
if *in == nil {
*out = nil
} else {
*out = new(intstr.IntOrString) *out = new(intstr.IntOrString)
**out = **in **out = **in
} }
}
return return
} }
@@ -1489,13 +1389,9 @@ func (in *SELinuxStrategyOptions) DeepCopyInto(out *SELinuxStrategyOptions) {
*out = *in *out = *in
if in.SELinuxOptions != nil { if in.SELinuxOptions != nil {
in, out := &in.SELinuxOptions, &out.SELinuxOptions in, out := &in.SELinuxOptions, &out.SELinuxOptions
if *in == nil {
*out = nil
} else {
*out = new(core_v1.SELinuxOptions) *out = new(core_v1.SELinuxOptions)
**out = **in **out = **in
} }
}
return return
} }
-20
View File
@@ -173,31 +173,19 @@ func (in *NetworkPolicyPeer) DeepCopyInto(out *NetworkPolicyPeer) {
*out = *in *out = *in
if in.PodSelector != nil { if in.PodSelector != nil {
in, out := &in.PodSelector, &out.PodSelector in, out := &in.PodSelector, &out.PodSelector
if *in == nil {
*out = nil
} else {
*out = new(meta_v1.LabelSelector) *out = new(meta_v1.LabelSelector)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
if in.NamespaceSelector != nil { if in.NamespaceSelector != nil {
in, out := &in.NamespaceSelector, &out.NamespaceSelector in, out := &in.NamespaceSelector, &out.NamespaceSelector
if *in == nil {
*out = nil
} else {
*out = new(meta_v1.LabelSelector) *out = new(meta_v1.LabelSelector)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
if in.IPBlock != nil { if in.IPBlock != nil {
in, out := &in.IPBlock, &out.IPBlock in, out := &in.IPBlock, &out.IPBlock
if *in == nil {
*out = nil
} else {
*out = new(IPBlock) *out = new(IPBlock)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
return return
} }
@@ -216,22 +204,14 @@ func (in *NetworkPolicyPort) DeepCopyInto(out *NetworkPolicyPort) {
*out = *in *out = *in
if in.Protocol != nil { if in.Protocol != nil {
in, out := &in.Protocol, &out.Protocol in, out := &in.Protocol, &out.Protocol
if *in == nil {
*out = nil
} else {
*out = new(core_v1.Protocol) *out = new(core_v1.Protocol)
**out = **in **out = **in
} }
}
if in.Port != nil { if in.Port != nil {
in, out := &in.Port, &out.Port in, out := &in.Port, &out.Port
if *in == nil {
*out = nil
} else {
*out = new(intstr.IntOrString) *out = new(intstr.IntOrString)
**out = **in **out = **in
} }
}
return return
} }
-28
View File
@@ -66,13 +66,9 @@ func (in *Eviction) DeepCopyInto(out *Eviction) {
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
if in.DeleteOptions != nil { if in.DeleteOptions != nil {
in, out := &in.DeleteOptions, &out.DeleteOptions in, out := &in.DeleteOptions, &out.DeleteOptions
if *in == nil {
*out = nil
} else {
*out = new(v1.DeleteOptions) *out = new(v1.DeleteOptions)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
return return
} }
@@ -213,31 +209,19 @@ func (in *PodDisruptionBudgetSpec) DeepCopyInto(out *PodDisruptionBudgetSpec) {
*out = *in *out = *in
if in.MinAvailable != nil { if in.MinAvailable != nil {
in, out := &in.MinAvailable, &out.MinAvailable in, out := &in.MinAvailable, &out.MinAvailable
if *in == nil {
*out = nil
} else {
*out = new(intstr.IntOrString) *out = new(intstr.IntOrString)
**out = **in **out = **in
} }
}
if in.Selector != nil { if in.Selector != nil {
in, out := &in.Selector, &out.Selector in, out := &in.Selector, &out.Selector
if *in == nil {
*out = nil
} else {
*out = new(v1.LabelSelector) *out = new(v1.LabelSelector)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
if in.MaxUnavailable != nil { if in.MaxUnavailable != nil {
in, out := &in.MaxUnavailable, &out.MaxUnavailable in, out := &in.MaxUnavailable, &out.MaxUnavailable
if *in == nil {
*out = nil
} else {
*out = new(intstr.IntOrString) *out = new(intstr.IntOrString)
**out = **in **out = **in
} }
}
return return
} }
@@ -368,22 +352,14 @@ func (in *PodSecurityPolicySpec) DeepCopyInto(out *PodSecurityPolicySpec) {
in.FSGroup.DeepCopyInto(&out.FSGroup) in.FSGroup.DeepCopyInto(&out.FSGroup)
if in.DefaultAllowPrivilegeEscalation != nil { if in.DefaultAllowPrivilegeEscalation != nil {
in, out := &in.DefaultAllowPrivilegeEscalation, &out.DefaultAllowPrivilegeEscalation in, out := &in.DefaultAllowPrivilegeEscalation, &out.DefaultAllowPrivilegeEscalation
if *in == nil {
*out = nil
} else {
*out = new(bool) *out = new(bool)
**out = **in **out = **in
} }
}
if in.AllowPrivilegeEscalation != nil { if in.AllowPrivilegeEscalation != nil {
in, out := &in.AllowPrivilegeEscalation, &out.AllowPrivilegeEscalation in, out := &in.AllowPrivilegeEscalation, &out.AllowPrivilegeEscalation
if *in == nil {
*out = nil
} else {
*out = new(bool) *out = new(bool)
**out = **in **out = **in
} }
}
if in.AllowedHostPaths != nil { if in.AllowedHostPaths != nil {
in, out := &in.AllowedHostPaths, &out.AllowedHostPaths in, out := &in.AllowedHostPaths, &out.AllowedHostPaths
*out = make([]AllowedHostPath, len(*in)) *out = make([]AllowedHostPath, len(*in))
@@ -443,13 +419,9 @@ func (in *SELinuxStrategyOptions) DeepCopyInto(out *SELinuxStrategyOptions) {
*out = *in *out = *in
if in.SELinuxOptions != nil { if in.SELinuxOptions != nil {
in, out := &in.SELinuxOptions, &out.SELinuxOptions in, out := &in.SELinuxOptions, &out.SELinuxOptions
if *in == nil {
*out = nil
} else {
*out = new(core_v1.SELinuxOptions) *out = new(core_v1.SELinuxOptions)
**out = **in **out = **in
} }
}
return return
} }
-4
View File
@@ -62,13 +62,9 @@ func (in *ClusterRole) DeepCopyInto(out *ClusterRole) {
} }
if in.AggregationRule != nil { if in.AggregationRule != nil {
in, out := &in.AggregationRule, &out.AggregationRule in, out := &in.AggregationRule, &out.AggregationRule
if *in == nil {
*out = nil
} else {
*out = new(AggregationRule) *out = new(AggregationRule)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
return return
} }
-4
View File
@@ -62,13 +62,9 @@ func (in *ClusterRole) DeepCopyInto(out *ClusterRole) {
} }
if in.AggregationRule != nil { if in.AggregationRule != nil {
in, out := &in.AggregationRule, &out.AggregationRule in, out := &in.AggregationRule, &out.AggregationRule
if *in == nil {
*out = nil
} else {
*out = new(AggregationRule) *out = new(AggregationRule)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
return return
} }
-4
View File
@@ -62,13 +62,9 @@ func (in *ClusterRole) DeepCopyInto(out *ClusterRole) {
} }
if in.AggregationRule != nil { if in.AggregationRule != nil {
in, out := &in.AggregationRule, &out.AggregationRule in, out := &in.AggregationRule, &out.AggregationRule
if *in == nil {
*out = nil
} else {
*out = new(AggregationRule) *out = new(AggregationRule)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
return return
} }
-12
View File
@@ -39,13 +39,9 @@ func (in *StorageClass) DeepCopyInto(out *StorageClass) {
} }
if in.ReclaimPolicy != nil { if in.ReclaimPolicy != nil {
in, out := &in.ReclaimPolicy, &out.ReclaimPolicy in, out := &in.ReclaimPolicy, &out.ReclaimPolicy
if *in == nil {
*out = nil
} else {
*out = new(core_v1.PersistentVolumeReclaimPolicy) *out = new(core_v1.PersistentVolumeReclaimPolicy)
**out = **in **out = **in
} }
}
if in.MountOptions != nil { if in.MountOptions != nil {
in, out := &in.MountOptions, &out.MountOptions in, out := &in.MountOptions, &out.MountOptions
*out = make([]string, len(*in)) *out = make([]string, len(*in))
@@ -53,22 +49,14 @@ func (in *StorageClass) DeepCopyInto(out *StorageClass) {
} }
if in.AllowVolumeExpansion != nil { if in.AllowVolumeExpansion != nil {
in, out := &in.AllowVolumeExpansion, &out.AllowVolumeExpansion in, out := &in.AllowVolumeExpansion, &out.AllowVolumeExpansion
if *in == nil {
*out = nil
} else {
*out = new(bool) *out = new(bool)
**out = **in **out = **in
} }
}
if in.VolumeBindingMode != nil { if in.VolumeBindingMode != nil {
in, out := &in.VolumeBindingMode, &out.VolumeBindingMode in, out := &in.VolumeBindingMode, &out.VolumeBindingMode
if *in == nil {
*out = nil
} else {
*out = new(VolumeBindingMode) *out = new(VolumeBindingMode)
**out = **in **out = **in
} }
}
if in.AllowedTopologies != nil { if in.AllowedTopologies != nil {
in, out := &in.AllowedTopologies, &out.AllowedTopologies in, out := &in.AllowedTopologies, &out.AllowedTopologies
*out = make([]core_v1.TopologySelectorTerm, len(*in)) *out = make([]core_v1.TopologySelectorTerm, len(*in))
-12
View File
@@ -90,13 +90,9 @@ func (in *VolumeAttachmentSource) DeepCopyInto(out *VolumeAttachmentSource) {
*out = *in *out = *in
if in.PersistentVolumeName != nil { if in.PersistentVolumeName != nil {
in, out := &in.PersistentVolumeName, &out.PersistentVolumeName in, out := &in.PersistentVolumeName, &out.PersistentVolumeName
if *in == nil {
*out = nil
} else {
*out = new(string) *out = new(string)
**out = **in **out = **in
} }
}
return return
} }
@@ -139,22 +135,14 @@ func (in *VolumeAttachmentStatus) DeepCopyInto(out *VolumeAttachmentStatus) {
} }
if in.AttachError != nil { if in.AttachError != nil {
in, out := &in.AttachError, &out.AttachError in, out := &in.AttachError, &out.AttachError
if *in == nil {
*out = nil
} else {
*out = new(VolumeError) *out = new(VolumeError)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
if in.DetachError != nil { if in.DetachError != nil {
in, out := &in.DetachError, &out.DetachError in, out := &in.DetachError, &out.DetachError
if *in == nil {
*out = nil
} else {
*out = new(VolumeError) *out = new(VolumeError)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
return return
} }
-24
View File
@@ -39,13 +39,9 @@ func (in *StorageClass) DeepCopyInto(out *StorageClass) {
} }
if in.ReclaimPolicy != nil { if in.ReclaimPolicy != nil {
in, out := &in.ReclaimPolicy, &out.ReclaimPolicy in, out := &in.ReclaimPolicy, &out.ReclaimPolicy
if *in == nil {
*out = nil
} else {
*out = new(v1.PersistentVolumeReclaimPolicy) *out = new(v1.PersistentVolumeReclaimPolicy)
**out = **in **out = **in
} }
}
if in.MountOptions != nil { if in.MountOptions != nil {
in, out := &in.MountOptions, &out.MountOptions in, out := &in.MountOptions, &out.MountOptions
*out = make([]string, len(*in)) *out = make([]string, len(*in))
@@ -53,22 +49,14 @@ func (in *StorageClass) DeepCopyInto(out *StorageClass) {
} }
if in.AllowVolumeExpansion != nil { if in.AllowVolumeExpansion != nil {
in, out := &in.AllowVolumeExpansion, &out.AllowVolumeExpansion in, out := &in.AllowVolumeExpansion, &out.AllowVolumeExpansion
if *in == nil {
*out = nil
} else {
*out = new(bool) *out = new(bool)
**out = **in **out = **in
} }
}
if in.VolumeBindingMode != nil { if in.VolumeBindingMode != nil {
in, out := &in.VolumeBindingMode, &out.VolumeBindingMode in, out := &in.VolumeBindingMode, &out.VolumeBindingMode
if *in == nil {
*out = nil
} else {
*out = new(VolumeBindingMode) *out = new(VolumeBindingMode)
**out = **in **out = **in
} }
}
if in.AllowedTopologies != nil { if in.AllowedTopologies != nil {
in, out := &in.AllowedTopologies, &out.AllowedTopologies in, out := &in.AllowedTopologies, &out.AllowedTopologies
*out = make([]v1.TopologySelectorTerm, len(*in)) *out = make([]v1.TopologySelectorTerm, len(*in))
@@ -196,13 +184,9 @@ func (in *VolumeAttachmentSource) DeepCopyInto(out *VolumeAttachmentSource) {
*out = *in *out = *in
if in.PersistentVolumeName != nil { if in.PersistentVolumeName != nil {
in, out := &in.PersistentVolumeName, &out.PersistentVolumeName in, out := &in.PersistentVolumeName, &out.PersistentVolumeName
if *in == nil {
*out = nil
} else {
*out = new(string) *out = new(string)
**out = **in **out = **in
} }
}
return return
} }
@@ -245,22 +229,14 @@ func (in *VolumeAttachmentStatus) DeepCopyInto(out *VolumeAttachmentStatus) {
} }
if in.AttachError != nil { if in.AttachError != nil {
in, out := &in.AttachError, &out.AttachError in, out := &in.AttachError, &out.AttachError
if *in == nil {
*out = nil
} else {
*out = new(VolumeError) *out = new(VolumeError)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
if in.DetachError != nil { if in.DetachError != nil {
in, out := &in.DetachError, &out.DetachError in, out := &in.DetachError, &out.DetachError
if *in == nil {
*out = nil
} else {
*out = new(VolumeError) *out = new(VolumeError)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
return return
} }
@@ -77,13 +77,9 @@ func (in *ListOptions) DeepCopyInto(out *ListOptions) {
} }
if in.TimeoutSeconds != nil { if in.TimeoutSeconds != nil {
in, out := &in.TimeoutSeconds, &out.TimeoutSeconds in, out := &in.TimeoutSeconds, &out.TimeoutSeconds
if *in == nil {
*out = nil
} else {
*out = new(int64) *out = new(int64)
**out = **in **out = **in
} }
}
return return
} }
-52
View File
@@ -197,40 +197,24 @@ func (in *DeleteOptions) DeepCopyInto(out *DeleteOptions) {
out.TypeMeta = in.TypeMeta out.TypeMeta = in.TypeMeta
if in.GracePeriodSeconds != nil { if in.GracePeriodSeconds != nil {
in, out := &in.GracePeriodSeconds, &out.GracePeriodSeconds in, out := &in.GracePeriodSeconds, &out.GracePeriodSeconds
if *in == nil {
*out = nil
} else {
*out = new(int64) *out = new(int64)
**out = **in **out = **in
} }
}
if in.Preconditions != nil { if in.Preconditions != nil {
in, out := &in.Preconditions, &out.Preconditions in, out := &in.Preconditions, &out.Preconditions
if *in == nil {
*out = nil
} else {
*out = new(Preconditions) *out = new(Preconditions)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
if in.OrphanDependents != nil { if in.OrphanDependents != nil {
in, out := &in.OrphanDependents, &out.OrphanDependents in, out := &in.OrphanDependents, &out.OrphanDependents
if *in == nil {
*out = nil
} else {
*out = new(bool) *out = new(bool)
**out = **in **out = **in
} }
}
if in.PropagationPolicy != nil { if in.PropagationPolicy != nil {
in, out := &in.PropagationPolicy, &out.PropagationPolicy in, out := &in.PropagationPolicy, &out.PropagationPolicy
if *in == nil {
*out = nil
} else {
*out = new(DeletionPropagation) *out = new(DeletionPropagation)
**out = **in **out = **in
} }
}
return return
} }
@@ -440,13 +424,9 @@ func (in *Initializers) DeepCopyInto(out *Initializers) {
} }
if in.Result != nil { if in.Result != nil {
in, out := &in.Result, &out.Result in, out := &in.Result, &out.Result
if *in == nil {
*out = nil
} else {
*out = new(Status) *out = new(Status)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
return return
} }
@@ -587,13 +567,9 @@ func (in *ListOptions) DeepCopyInto(out *ListOptions) {
out.TypeMeta = in.TypeMeta out.TypeMeta = in.TypeMeta
if in.TimeoutSeconds != nil { if in.TimeoutSeconds != nil {
in, out := &in.TimeoutSeconds, &out.TimeoutSeconds in, out := &in.TimeoutSeconds, &out.TimeoutSeconds
if *in == nil {
*out = nil
} else {
*out = new(int64) *out = new(int64)
**out = **in **out = **in
} }
}
return return
} }
@@ -631,21 +607,13 @@ func (in *ObjectMeta) DeepCopyInto(out *ObjectMeta) {
in.CreationTimestamp.DeepCopyInto(&out.CreationTimestamp) in.CreationTimestamp.DeepCopyInto(&out.CreationTimestamp)
if in.DeletionTimestamp != nil { if in.DeletionTimestamp != nil {
in, out := &in.DeletionTimestamp, &out.DeletionTimestamp in, out := &in.DeletionTimestamp, &out.DeletionTimestamp
if *in == nil {
*out = nil
} else {
*out = (*in).DeepCopy() *out = (*in).DeepCopy()
} }
}
if in.DeletionGracePeriodSeconds != nil { if in.DeletionGracePeriodSeconds != nil {
in, out := &in.DeletionGracePeriodSeconds, &out.DeletionGracePeriodSeconds in, out := &in.DeletionGracePeriodSeconds, &out.DeletionGracePeriodSeconds
if *in == nil {
*out = nil
} else {
*out = new(int64) *out = new(int64)
**out = **in **out = **in
} }
}
if in.Labels != nil { if in.Labels != nil {
in, out := &in.Labels, &out.Labels in, out := &in.Labels, &out.Labels
*out = make(map[string]string, len(*in)) *out = make(map[string]string, len(*in))
@@ -669,13 +637,9 @@ func (in *ObjectMeta) DeepCopyInto(out *ObjectMeta) {
} }
if in.Initializers != nil { if in.Initializers != nil {
in, out := &in.Initializers, &out.Initializers in, out := &in.Initializers, &out.Initializers
if *in == nil {
*out = nil
} else {
*out = new(Initializers) *out = new(Initializers)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
if in.Finalizers != nil { if in.Finalizers != nil {
in, out := &in.Finalizers, &out.Finalizers in, out := &in.Finalizers, &out.Finalizers
*out = make([]string, len(*in)) *out = make([]string, len(*in))
@@ -699,22 +663,14 @@ func (in *OwnerReference) DeepCopyInto(out *OwnerReference) {
*out = *in *out = *in
if in.Controller != nil { if in.Controller != nil {
in, out := &in.Controller, &out.Controller in, out := &in.Controller, &out.Controller
if *in == nil {
*out = nil
} else {
*out = new(bool) *out = new(bool)
**out = **in **out = **in
} }
}
if in.BlockOwnerDeletion != nil { if in.BlockOwnerDeletion != nil {
in, out := &in.BlockOwnerDeletion, &out.BlockOwnerDeletion in, out := &in.BlockOwnerDeletion, &out.BlockOwnerDeletion
if *in == nil {
*out = nil
} else {
*out = new(bool) *out = new(bool)
**out = **in **out = **in
} }
}
return return
} }
@@ -749,13 +705,9 @@ func (in *Preconditions) DeepCopyInto(out *Preconditions) {
*out = *in *out = *in
if in.UID != nil { if in.UID != nil {
in, out := &in.UID, &out.UID in, out := &in.UID, &out.UID
if *in == nil {
*out = nil
} else {
*out = new(types.UID) *out = new(types.UID)
**out = **in **out = **in
} }
}
return return
} }
@@ -813,13 +765,9 @@ func (in *Status) DeepCopyInto(out *Status) {
out.ListMeta = in.ListMeta out.ListMeta = in.ListMeta
if in.Details != nil { if in.Details != nil {
in, out := &in.Details, &out.Details in, out := &in.Details, &out.Details
if *in == nil {
*out = nil
} else {
*out = new(StatusDetails) *out = new(StatusDetails)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
return return
} }
+3 -2
View File
@@ -61,8 +61,9 @@ func (in *PartialObjectMetadataList) DeepCopyInto(out *PartialObjectMetadataList
if (*in)[i] == nil { if (*in)[i] == nil {
(*out)[i] = nil (*out)[i] = nil
} else { } else {
(*out)[i] = new(PartialObjectMetadata) in, out := &(*in)[i], &(*out)[i]
(*in)[i].DeepCopyInto((*out)[i]) *out = new(PartialObjectMetadata)
(*in).DeepCopyInto(*out)
} }
} }
} }
+26 -8
View File
@@ -24,6 +24,7 @@ import (
"github.com/ghodss/yaml" "github.com/ghodss/yaml"
jsoniter "github.com/json-iterator/go" jsoniter "github.com/json-iterator/go"
"github.com/modern-go/reflect2"
"k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/schema"
@@ -68,12 +69,24 @@ type Serializer struct {
var _ runtime.Serializer = &Serializer{} var _ runtime.Serializer = &Serializer{}
var _ recognizer.RecognizingDecoder = &Serializer{} var _ recognizer.RecognizingDecoder = &Serializer{}
func init() { type customNumberExtension struct {
// Force jsoniter to decode number to interface{} via ints, if possible. jsoniter.DummyExtension
decodeNumberAsInt64IfPossible := func(ptr unsafe.Pointer, iter *jsoniter.Iterator) { }
func (cne *customNumberExtension) CreateDecoder(typ reflect2.Type) jsoniter.ValDecoder {
if typ.String() == "interface {}" {
return customNumberDecoder{}
}
return nil
}
type customNumberDecoder struct {
}
func (customNumberDecoder) Decode(ptr unsafe.Pointer, iter *jsoniter.Iterator) {
switch iter.WhatIsNext() { switch iter.WhatIsNext() {
case jsoniter.NumberValue: case jsoniter.NumberValue:
var number json.Number var number jsoniter.Number
iter.ReadVal(&number) iter.ReadVal(&number)
i64, err := strconv.ParseInt(string(number), 10, 64) i64, err := strconv.ParseInt(string(number), 10, 64)
if err == nil { if err == nil {
@@ -85,26 +98,31 @@ func init() {
*(*interface{})(ptr) = f64 *(*interface{})(ptr) = f64
return return
} }
// Not much we can do here. iter.ReportError("DecodeNumber", err.Error())
default: default:
*(*interface{})(ptr) = iter.Read() *(*interface{})(ptr) = iter.Read()
} }
} }
jsoniter.RegisterTypeDecoderFunc("interface {}", decodeNumberAsInt64IfPossible)
}
// CaseSensitiveJsonIterator returns a jsoniterator API that's configured to be // CaseSensitiveJsonIterator returns a jsoniterator API that's configured to be
// case-sensitive when unmarshalling, and otherwise compatible with // case-sensitive when unmarshalling, and otherwise compatible with
// the encoding/json standard library. // the encoding/json standard library.
func CaseSensitiveJsonIterator() jsoniter.API { func CaseSensitiveJsonIterator() jsoniter.API {
return jsoniter.Config{ config := jsoniter.Config{
EscapeHTML: true, EscapeHTML: true,
SortMapKeys: true, SortMapKeys: true,
ValidateJsonRawMessage: true, ValidateJsonRawMessage: true,
CaseSensitive: true, CaseSensitive: true,
}.Froze() }.Froze()
// Force jsoniter to decode number to interface{} via int64/float64, if possible.
config.RegisterExtension(&customNumberExtension{})
return config
} }
// Private copy of jsoniter to try to shield against possible mutations
// from outside. Still does not protect from package level jsoniter.Register*() functions - someone calling them
// in some other library will mess with every usage of the jsoniter library in the whole program.
// See https://github.com/json-iterator/go/issues/265
var caseSensitiveJsonIterator = CaseSensitiveJsonIterator() var caseSensitiveJsonIterator = CaseSensitiveJsonIterator()
// gvkWithDefaults returns group kind and version defaulting from provided default // gvkWithDefaults returns group kind and version defaulting from provided default
@@ -31,13 +31,9 @@ func (in *ExecCredential) DeepCopyInto(out *ExecCredential) {
in.Spec.DeepCopyInto(&out.Spec) in.Spec.DeepCopyInto(&out.Spec)
if in.Status != nil { if in.Status != nil {
in, out := &in.Status, &out.Status in, out := &in.Status, &out.Status
if *in == nil {
*out = nil
} else {
*out = new(ExecCredentialStatus) *out = new(ExecCredentialStatus)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
return return
} }
@@ -64,13 +60,9 @@ func (in *ExecCredentialSpec) DeepCopyInto(out *ExecCredentialSpec) {
*out = *in *out = *in
if in.Response != nil { if in.Response != nil {
in, out := &in.Response, &out.Response in, out := &in.Response, &out.Response
if *in == nil {
*out = nil
} else {
*out = new(Response) *out = new(Response)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
return return
} }
@@ -89,12 +81,8 @@ func (in *ExecCredentialStatus) DeepCopyInto(out *ExecCredentialStatus) {
*out = *in *out = *in
if in.ExpirationTimestamp != nil { if in.ExpirationTimestamp != nil {
in, out := &in.ExpirationTimestamp, &out.ExpirationTimestamp in, out := &in.ExpirationTimestamp, &out.ExpirationTimestamp
if *in == nil {
*out = nil
} else {
*out = (*in).DeepCopy() *out = (*in).DeepCopy()
} }
}
return return
} }
@@ -115,12 +103,15 @@ func (in *Response) DeepCopyInto(out *Response) {
in, out := &in.Header, &out.Header in, out := &in.Header, &out.Header
*out = make(map[string][]string, len(*in)) *out = make(map[string][]string, len(*in))
for key, val := range *in { for key, val := range *in {
var outVal []string
if val == nil { if val == nil {
(*out)[key] = nil (*out)[key] = nil
} else { } else {
(*out)[key] = make([]string, len(val)) in, out := &val, &outVal
copy((*out)[key], val) *out = make([]string, len(*in))
copy(*out, *in)
} }
(*out)[key] = outVal
} }
} }
return return
@@ -31,13 +31,9 @@ func (in *ExecCredential) DeepCopyInto(out *ExecCredential) {
out.Spec = in.Spec out.Spec = in.Spec
if in.Status != nil { if in.Status != nil {
in, out := &in.Status, &out.Status in, out := &in.Status, &out.Status
if *in == nil {
*out = nil
} else {
*out = new(ExecCredentialStatus) *out = new(ExecCredentialStatus)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
return return
} }
@@ -80,12 +76,8 @@ func (in *ExecCredentialStatus) DeepCopyInto(out *ExecCredentialStatus) {
*out = *in *out = *in
if in.ExpirationTimestamp != nil { if in.ExpirationTimestamp != nil {
in, out := &in.ExpirationTimestamp, &out.ExpirationTimestamp in, out := &in.ExpirationTimestamp, &out.ExpirationTimestamp
if *in == nil {
*out = nil
} else {
*out = (*in).DeepCopy() *out = (*in).DeepCopy()
} }
}
return return
} }
@@ -31,13 +31,9 @@ func (in *ExecCredential) DeepCopyInto(out *ExecCredential) {
in.Spec.DeepCopyInto(&out.Spec) in.Spec.DeepCopyInto(&out.Spec)
if in.Status != nil { if in.Status != nil {
in, out := &in.Status, &out.Status in, out := &in.Status, &out.Status
if *in == nil {
*out = nil
} else {
*out = new(ExecCredentialStatus) *out = new(ExecCredentialStatus)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
return return
} }
@@ -64,13 +60,9 @@ func (in *ExecCredentialSpec) DeepCopyInto(out *ExecCredentialSpec) {
*out = *in *out = *in
if in.Response != nil { if in.Response != nil {
in, out := &in.Response, &out.Response in, out := &in.Response, &out.Response
if *in == nil {
*out = nil
} else {
*out = new(Response) *out = new(Response)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
return return
} }
@@ -89,12 +81,8 @@ func (in *ExecCredentialStatus) DeepCopyInto(out *ExecCredentialStatus) {
*out = *in *out = *in
if in.ExpirationTimestamp != nil { if in.ExpirationTimestamp != nil {
in, out := &in.ExpirationTimestamp, &out.ExpirationTimestamp in, out := &in.ExpirationTimestamp, &out.ExpirationTimestamp
if *in == nil {
*out = nil
} else {
*out = (*in).DeepCopy() *out = (*in).DeepCopy()
} }
}
return return
} }
@@ -115,12 +103,15 @@ func (in *Response) DeepCopyInto(out *Response) {
in, out := &in.Header, &out.Header in, out := &in.Header, &out.Header
*out = make(map[string][]string, len(*in)) *out = make(map[string][]string, len(*in))
for key, val := range *in { for key, val := range *in {
var outVal []string
if val == nil { if val == nil {
(*out)[key] = nil (*out)[key] = nil
} else { } else {
(*out)[key] = make([]string, len(val)) in, out := &val, &outVal
copy((*out)[key], val) *out = make([]string, len(*in))
copy(*out, *in)
} }
(*out)[key] = outVal
} }
} }
return return
+5 -10
View File
@@ -46,32 +46,27 @@ func (in *AuthInfo) DeepCopyInto(out *AuthInfo) {
in, out := &in.ImpersonateUserExtra, &out.ImpersonateUserExtra in, out := &in.ImpersonateUserExtra, &out.ImpersonateUserExtra
*out = make(map[string][]string, len(*in)) *out = make(map[string][]string, len(*in))
for key, val := range *in { for key, val := range *in {
var outVal []string
if val == nil { if val == nil {
(*out)[key] = nil (*out)[key] = nil
} else { } else {
(*out)[key] = make([]string, len(val)) in, out := &val, &outVal
copy((*out)[key], val) *out = make([]string, len(*in))
copy(*out, *in)
} }
(*out)[key] = outVal
} }
} }
if in.AuthProvider != nil { if in.AuthProvider != nil {
in, out := &in.AuthProvider, &out.AuthProvider in, out := &in.AuthProvider, &out.AuthProvider
if *in == nil {
*out = nil
} else {
*out = new(AuthProviderConfig) *out = new(AuthProviderConfig)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
if in.Exec != nil { if in.Exec != nil {
in, out := &in.Exec, &out.Exec in, out := &in.Exec, &out.Exec
if *in == nil {
*out = nil
} else {
*out = new(ExecConfig) *out = new(ExecConfig)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
if in.Extensions != nil { if in.Extensions != nil {
in, out := &in.Extensions, &out.Extensions in, out := &in.Extensions, &out.Extensions
*out = make([]NamedExtension, len(*in)) *out = make([]NamedExtension, len(*in))
+20 -16
View File
@@ -46,32 +46,27 @@ func (in *AuthInfo) DeepCopyInto(out *AuthInfo) {
in, out := &in.ImpersonateUserExtra, &out.ImpersonateUserExtra in, out := &in.ImpersonateUserExtra, &out.ImpersonateUserExtra
*out = make(map[string][]string, len(*in)) *out = make(map[string][]string, len(*in))
for key, val := range *in { for key, val := range *in {
var outVal []string
if val == nil { if val == nil {
(*out)[key] = nil (*out)[key] = nil
} else { } else {
(*out)[key] = make([]string, len(val)) in, out := &val, &outVal
copy((*out)[key], val) *out = make([]string, len(*in))
copy(*out, *in)
} }
(*out)[key] = outVal
} }
} }
if in.AuthProvider != nil { if in.AuthProvider != nil {
in, out := &in.AuthProvider, &out.AuthProvider in, out := &in.AuthProvider, &out.AuthProvider
if *in == nil {
*out = nil
} else {
*out = new(AuthProviderConfig) *out = new(AuthProviderConfig)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
if in.Exec != nil { if in.Exec != nil {
in, out := &in.Exec, &out.Exec in, out := &in.Exec, &out.Exec
if *in == nil {
*out = nil
} else {
*out = new(ExecConfig) *out = new(ExecConfig)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
}
if in.Extensions != nil { if in.Extensions != nil {
in, out := &in.Extensions, &out.Extensions in, out := &in.Extensions, &out.Extensions
*out = make(map[string]runtime.Object, len(*in)) *out = make(map[string]runtime.Object, len(*in))
@@ -159,36 +154,45 @@ func (in *Config) DeepCopyInto(out *Config) {
in, out := &in.Clusters, &out.Clusters in, out := &in.Clusters, &out.Clusters
*out = make(map[string]*Cluster, len(*in)) *out = make(map[string]*Cluster, len(*in))
for key, val := range *in { for key, val := range *in {
var outVal *Cluster
if val == nil { if val == nil {
(*out)[key] = nil (*out)[key] = nil
} else { } else {
(*out)[key] = new(Cluster) in, out := &val, &outVal
val.DeepCopyInto((*out)[key]) *out = new(Cluster)
(*in).DeepCopyInto(*out)
} }
(*out)[key] = outVal
} }
} }
if in.AuthInfos != nil { if in.AuthInfos != nil {
in, out := &in.AuthInfos, &out.AuthInfos in, out := &in.AuthInfos, &out.AuthInfos
*out = make(map[string]*AuthInfo, len(*in)) *out = make(map[string]*AuthInfo, len(*in))
for key, val := range *in { for key, val := range *in {
var outVal *AuthInfo
if val == nil { if val == nil {
(*out)[key] = nil (*out)[key] = nil
} else { } else {
(*out)[key] = new(AuthInfo) in, out := &val, &outVal
val.DeepCopyInto((*out)[key]) *out = new(AuthInfo)
(*in).DeepCopyInto(*out)
} }
(*out)[key] = outVal
} }
} }
if in.Contexts != nil { if in.Contexts != nil {
in, out := &in.Contexts, &out.Contexts in, out := &in.Contexts, &out.Contexts
*out = make(map[string]*Context, len(*in)) *out = make(map[string]*Context, len(*in))
for key, val := range *in { for key, val := range *in {
var outVal *Context
if val == nil { if val == nil {
(*out)[key] = nil (*out)[key] = nil
} else { } else {
(*out)[key] = new(Context) in, out := &val, &outVal
val.DeepCopyInto((*out)[key]) *out = new(Context)
(*in).DeepCopyInto(*out)
} }
(*out)[key] = outVal
} }
} }
if in.Extensions != nil { if in.Extensions != nil {
+10 -10
View File
@@ -220,43 +220,43 @@
}, },
{ {
"ImportPath": "k8s.io/gengo/args", "ImportPath": "k8s.io/gengo/args",
"Rev": "01a732e01d00cb9a81bb0ca050d3e6d2b947927b" "Rev": "dcbe4570f0cf6efbc583a5321c8f9390f71a544d"
}, },
{ {
"ImportPath": "k8s.io/gengo/examples/deepcopy-gen/generators", "ImportPath": "k8s.io/gengo/examples/deepcopy-gen/generators",
"Rev": "01a732e01d00cb9a81bb0ca050d3e6d2b947927b" "Rev": "dcbe4570f0cf6efbc583a5321c8f9390f71a544d"
}, },
{ {
"ImportPath": "k8s.io/gengo/examples/defaulter-gen/generators", "ImportPath": "k8s.io/gengo/examples/defaulter-gen/generators",
"Rev": "01a732e01d00cb9a81bb0ca050d3e6d2b947927b" "Rev": "dcbe4570f0cf6efbc583a5321c8f9390f71a544d"
}, },
{ {
"ImportPath": "k8s.io/gengo/examples/import-boss/generators", "ImportPath": "k8s.io/gengo/examples/import-boss/generators",
"Rev": "01a732e01d00cb9a81bb0ca050d3e6d2b947927b" "Rev": "dcbe4570f0cf6efbc583a5321c8f9390f71a544d"
}, },
{ {
"ImportPath": "k8s.io/gengo/examples/set-gen/generators", "ImportPath": "k8s.io/gengo/examples/set-gen/generators",
"Rev": "01a732e01d00cb9a81bb0ca050d3e6d2b947927b" "Rev": "dcbe4570f0cf6efbc583a5321c8f9390f71a544d"
}, },
{ {
"ImportPath": "k8s.io/gengo/examples/set-gen/sets", "ImportPath": "k8s.io/gengo/examples/set-gen/sets",
"Rev": "01a732e01d00cb9a81bb0ca050d3e6d2b947927b" "Rev": "dcbe4570f0cf6efbc583a5321c8f9390f71a544d"
}, },
{ {
"ImportPath": "k8s.io/gengo/generator", "ImportPath": "k8s.io/gengo/generator",
"Rev": "01a732e01d00cb9a81bb0ca050d3e6d2b947927b" "Rev": "dcbe4570f0cf6efbc583a5321c8f9390f71a544d"
}, },
{ {
"ImportPath": "k8s.io/gengo/namer", "ImportPath": "k8s.io/gengo/namer",
"Rev": "01a732e01d00cb9a81bb0ca050d3e6d2b947927b" "Rev": "dcbe4570f0cf6efbc583a5321c8f9390f71a544d"
}, },
{ {
"ImportPath": "k8s.io/gengo/parser", "ImportPath": "k8s.io/gengo/parser",
"Rev": "01a732e01d00cb9a81bb0ca050d3e6d2b947927b" "Rev": "dcbe4570f0cf6efbc583a5321c8f9390f71a544d"
}, },
{ {
"ImportPath": "k8s.io/gengo/types", "ImportPath": "k8s.io/gengo/types",
"Rev": "01a732e01d00cb9a81bb0ca050d3e6d2b947927b" "Rev": "dcbe4570f0cf6efbc583a5321c8f9390f71a544d"
}, },
{ {
"ImportPath": "k8s.io/kube-openapi/pkg/common", "ImportPath": "k8s.io/kube-openapi/pkg/common",
@@ -683,7 +683,7 @@ func (g *genDeepCopy) generateFor(t *types.Type, sw *generator.SnippetWriter) {
// can never happen because we branch on the underlying type which is never an alias // can never happen because we branch on the underlying type which is never an alias
glog.Fatalf("Hit an alias type %v. This should never happen.", t) glog.Fatalf("Hit an alias type %v. This should never happen.", t)
default: default:
f = g.doUnknown glog.Fatalf("Hit an unsupported type %v.", t)
} }
f(t, sw) f(t, sw)
} }
@@ -710,12 +710,15 @@ func (g *genDeepCopy) doMap(t *types.Type, sw *generator.SnippetWriter) {
return return
} }
if !ut.Key.IsAssignable() {
glog.Fatalf("Hit an unsupported type %v.", uet)
}
sw.Do("*out = make($.|raw$, len(*in))\n", t) sw.Do("*out = make($.|raw$, len(*in))\n", t)
if ut.Key.IsAssignable() { sw.Do("for key, val := range *in {\n", nil)
dc, dci := deepCopyMethodOrDie(ut.Elem), deepCopyIntoMethodOrDie(ut.Elem) dc, dci := deepCopyMethodOrDie(ut.Elem), deepCopyIntoMethodOrDie(ut.Elem)
switch { switch {
case dc != nil || dci != nil: case dc != nil || dci != nil:
sw.Do("for key, val := range *in {\n", nil)
// Note: a DeepCopy exists because it is added if DeepCopyInto is manually defined // Note: a DeepCopy exists because it is added if DeepCopyInto is manually defined
leftPointer := ut.Elem.Kind == types.Pointer leftPointer := ut.Elem.Kind == types.Pointer
rightPointer := !isReference(ut.Elem) rightPointer := !isReference(ut.Elem)
@@ -730,51 +733,31 @@ func (g *genDeepCopy) doMap(t *types.Type, sw *generator.SnippetWriter) {
} else { } else {
sw.Do("(*out)[key] = *val.DeepCopy()\n", nil) sw.Do("(*out)[key] = *val.DeepCopy()\n", nil)
} }
sw.Do("}\n", nil)
case ut.Elem.IsAnonymousStruct(): // not uet here because it needs type cast case ut.Elem.IsAnonymousStruct(): // not uet here because it needs type cast
sw.Do("for key := range *in {\n", nil)
sw.Do("(*out)[key] = struct{}{}\n", nil)
sw.Do("}\n", nil)
case uet.IsAssignable():
sw.Do("for key, val := range *in {\n", nil)
sw.Do("(*out)[key] = val\n", nil) sw.Do("(*out)[key] = val\n", nil)
sw.Do("}\n", nil) case uet.IsAssignable():
sw.Do("(*out)[key] = val\n", nil)
case uet.Kind == types.Interface: case uet.Kind == types.Interface:
sw.Do("for key, val := range *in {\n", nil)
sw.Do("if val == nil {(*out)[key]=nil} else {\n", nil) sw.Do("if val == nil {(*out)[key]=nil} else {\n", nil)
// Note: if t.Elem has been an alias "J" of an interface "I" in Go, we will see it // Note: if t.Elem has been an alias "J" of an interface "I" in Go, we will see it
// as kind Interface of name "J" here, i.e. generate val.DeepCopyJ(). The golang // as kind Interface of name "J" here, i.e. generate val.DeepCopyJ(). The golang
// parser does not give us the underlying interface name. So we cannot do any better. // parser does not give us the underlying interface name. So we cannot do any better.
sw.Do(fmt.Sprintf("(*out)[key] = val.DeepCopy%s()\n", uet.Name.Name), nil) sw.Do(fmt.Sprintf("(*out)[key] = val.DeepCopy%s()\n", uet.Name.Name), nil)
sw.Do("}}\n", nil)
default:
sw.Do("for key, val := range *in {\n", nil)
if g.copyableAndInBounds(uet) {
sw.Do("newVal := new($.|raw$)\n", ut.Elem)
sw.Do("val.DeepCopyInto(newVal)\n", nil)
sw.Do("(*out)[key] = *newVal\n", nil)
} else if uet.Kind == types.Slice && underlyingType(uet.Elem).Kind == types.Builtin {
sw.Do("if val==nil { (*out)[key]=nil } else {\n", nil)
sw.Do("(*out)[key] = make($.|raw$, len(val))\n", uet)
sw.Do("copy((*out)[key], val)\n", nil)
sw.Do("}\n", nil) sw.Do("}\n", nil)
} else if uet.Kind == types.Pointer { case uet.Kind == types.Slice || uet.Kind == types.Map || uet.Kind == types.Pointer:
sw.Do("var outVal $.|raw$\n", uet)
sw.Do("if val == nil { (*out)[key] = nil } else {\n", nil) sw.Do("if val == nil { (*out)[key] = nil } else {\n", nil)
sw.Do("(*out)[key] = new($.Elem|raw$)\n", uet) sw.Do("in, out := &val, &outVal\n", uet)
sw.Do("val.DeepCopyInto((*out)[key])\n", nil) g.generateFor(ut.Elem, sw)
sw.Do("}\n", nil) sw.Do("}\n", nil)
} else { sw.Do("(*out)[key] = outVal\n", nil)
case uet.Kind == types.Struct:
sw.Do("(*out)[key] = *val.DeepCopy()\n", uet) sw.Do("(*out)[key] = *val.DeepCopy()\n", uet)
default:
glog.Fatalf("Hit an unsupported type %v.", uet)
} }
sw.Do("}\n", nil) sw.Do("}\n", nil)
} }
} else {
// TODO: Implement it when necessary.
sw.Do("for range *in {\n", nil)
sw.Do("// FIXME: Copying unassignable keys unsupported $.|raw$\n", ut.Key)
sw.Do("}\n", nil)
}
}
// doSlice generates code for a slice or an alias to a slice. The generated code is // doSlice generates code for a slice or an alias to a slice. The generated code is
// is the same for both cases, i.e. it's the code for the underlying type. // is the same for both cases, i.e. it's the code for the underlying type.
@@ -797,8 +780,8 @@ func (g *genDeepCopy) doSlice(t *types.Type, sw *generator.SnippetWriter) {
sw.Do("copy(*out, *in)\n", nil) sw.Do("copy(*out, *in)\n", nil)
} else { } else {
sw.Do("for i := range *in {\n", nil) sw.Do("for i := range *in {\n", nil)
if uet.Kind == types.Slice || uet.Kind == types.Map || deepCopyMethodOrDie(ut.Elem) != nil || deepCopyIntoMethodOrDie(ut.Elem) != nil { if uet.Kind == types.Slice || uet.Kind == types.Map || uet.Kind == types.Pointer || deepCopyMethodOrDie(ut.Elem) != nil || deepCopyIntoMethodOrDie(ut.Elem) != nil {
sw.Do("if (*in)[i] != nil {\n", nil) sw.Do("if (*in)[i] == nil { (*out)[i] = nil } else {\n", nil)
sw.Do("in, out := &(*in)[i], &(*out)[i]\n", nil) sw.Do("in, out := &(*in)[i], &(*out)[i]\n", nil)
g.generateFor(ut.Elem, sw) g.generateFor(ut.Elem, sw)
sw.Do("}\n", nil) sw.Do("}\n", nil)
@@ -809,15 +792,10 @@ func (g *genDeepCopy) doSlice(t *types.Type, sw *generator.SnippetWriter) {
// parser does not give us the underlying interface name. So we cannot do any better. // parser does not give us the underlying interface name. So we cannot do any better.
sw.Do(fmt.Sprintf("(*out)[i] = (*in)[i].DeepCopy%s()\n", uet.Name.Name), nil) sw.Do(fmt.Sprintf("(*out)[i] = (*in)[i].DeepCopy%s()\n", uet.Name.Name), nil)
sw.Do("}\n", nil) sw.Do("}\n", nil)
} else if uet.Kind == types.Pointer {
sw.Do("if (*in)[i]==nil { (*out)[i]=nil } else {\n", nil)
sw.Do("(*out)[i] = new($.Elem|raw$)\n", uet)
sw.Do("(*in)[i].DeepCopyInto((*out)[i])\n", nil)
sw.Do("}\n", nil)
} else if uet.Kind == types.Struct { } else if uet.Kind == types.Struct {
sw.Do("(*in)[i].DeepCopyInto(&(*out)[i])\n", nil) sw.Do("(*in)[i].DeepCopyInto(&(*out)[i])\n", nil)
} else { } else {
sw.Do("(*out)[i] = (*in)[i].DeepCopy()\n", nil) glog.Fatalf("Hit an unsupported type %v.", uet)
} }
sw.Do("}\n", nil) sw.Do("}\n", nil)
} }
@@ -885,7 +863,7 @@ func (g *genDeepCopy) doStruct(t *types.Type, sw *generator.SnippetWriter) {
sw.Do(fmt.Sprintf("out.$.name$ = in.$.name$.DeepCopy%s()\n", uft.Name.Name), args) sw.Do(fmt.Sprintf("out.$.name$ = in.$.name$.DeepCopy%s()\n", uft.Name.Name), args)
sw.Do("}\n", nil) sw.Do("}\n", nil)
default: default:
sw.Do("out.$.name$ = in.$.name$.DeepCopy()\n", args) glog.Fatalf("Hit an unsupported type %v.", uft)
} }
} }
} }
@@ -896,9 +874,9 @@ func (g *genDeepCopy) doPointer(t *types.Type, sw *generator.SnippetWriter) {
ut := underlyingType(t) ut := underlyingType(t)
uet := underlyingType(ut.Elem) uet := underlyingType(ut.Elem)
sw.Do("if *in == nil { *out = nil } else {\n", t)
dc, dci := deepCopyMethodOrDie(ut.Elem), deepCopyIntoMethodOrDie(ut.Elem) dc, dci := deepCopyMethodOrDie(ut.Elem), deepCopyIntoMethodOrDie(ut.Elem)
if dc != nil || dci != nil { switch {
case dc != nil || dci != nil:
rightPointer := !isReference(ut.Elem) rightPointer := !isReference(ut.Elem)
if dc != nil { if dc != nil {
rightPointer = dc.Results[0].Kind == types.Pointer rightPointer = dc.Results[0].Kind == types.Pointer
@@ -909,25 +887,19 @@ func (g *genDeepCopy) doPointer(t *types.Type, sw *generator.SnippetWriter) {
sw.Do("x := (*in).DeepCopy()\n", nil) sw.Do("x := (*in).DeepCopy()\n", nil)
sw.Do("*out = &x\n", nil) sw.Do("*out = &x\n", nil)
} }
} else if uet.IsAssignable() { case uet.IsAssignable():
sw.Do("*out = new($.Elem|raw$)\n", ut) sw.Do("*out = new($.Elem|raw$)\n", ut)
sw.Do("**out = **in", nil) sw.Do("**out = **in", nil)
} else { case uet.Kind == types.Map, uet.Kind == types.Slice, uet.Kind == types.Pointer:
switch uet.Kind {
case types.Map, types.Slice:
sw.Do("*out = new($.Elem|raw$)\n", ut) sw.Do("*out = new($.Elem|raw$)\n", ut)
sw.Do("if **in != nil {\n", nil) sw.Do("if **in != nil {\n", nil)
sw.Do("in, out := *in, *out\n", nil) sw.Do("in, out := *in, *out\n", nil)
g.generateFor(uet, sw) g.generateFor(uet, sw)
sw.Do("}\n", nil) sw.Do("}\n", nil)
default: case uet.Kind == types.Struct:
sw.Do("*out = new($.Elem|raw$)\n", ut) sw.Do("*out = new($.Elem|raw$)\n", ut)
sw.Do("(*in).DeepCopyInto(*out)\n", nil) sw.Do("(*in).DeepCopyInto(*out)\n", nil)
default:
glog.Fatalf("Hit an unsupported type %v.", uet)
} }
} }
sw.Do("}", t)
}
func (g *genDeepCopy) doUnknown(t *types.Type, sw *generator.SnippetWriter) {
sw.Do("// FIXME: Type $.|raw$ is unsupported.\n", t)
}
@@ -17,9 +17,10 @@ limitations under the License.
package generator package generator
import ( import (
"path/filepath"
"strings" "strings"
"github.com/golang/glog"
"k8s.io/gengo/namer" "k8s.io/gengo/namer"
"k8s.io/gengo/types" "k8s.io/gengo/types"
) )
@@ -37,7 +38,14 @@ func NewImportTracker(typesToAdd ...*types.Type) namer.ImportTracker {
func golangTrackerLocalName(tracker namer.ImportTracker, t types.Name) string { func golangTrackerLocalName(tracker namer.ImportTracker, t types.Name) string {
path := t.Package path := t.Package
dirs := strings.Split(path, string(filepath.Separator))
// Using backslashes in package names causes gengo to produce Go code which
// will not compile with the gc compiler. See the comment on GoSeperator.
if strings.ContainsRune(path, '\\') {
glog.Warningf("Warning: backslash used in import path '%v', this is unsupported.\n", path)
}
dirs := strings.Split(path, namer.GoSeperator)
for n := len(dirs) - 1; n >= 0; n-- { for n := len(dirs) - 1; n >= 0; n-- {
// TODO: bikeshed about whether it's more readable to have an // TODO: bikeshed about whether it's more readable to have an
// _, something else, or nothing between directory names. // _, something else, or nothing between directory names.
+12 -1
View File
@@ -23,6 +23,17 @@ import (
"k8s.io/gengo/types" "k8s.io/gengo/types"
) )
const (
// GoSeperator is used to split go import paths.
// Forward slash is used instead of filepath.Seperator because it is the
// only universally-accepted path delimiter and the only delimiter not
// potentially forbidden by Go compilers. (In particular gc does not allow
// the use of backslashes in import paths.)
// See https://golang.org/ref/spec#Import_declarations.
// See also https://github.com/kubernetes/gengo/issues/83#issuecomment-367040772.
GoSeperator = "/"
)
// Returns whether a name is a private Go name. // Returns whether a name is a private Go name.
func IsPrivateGoName(name string) bool { func IsPrivateGoName(name string) bool {
return len(name) == 0 || strings.ToLower(name[:1]) == name[:1] return len(name) == 0 || strings.ToLower(name[:1]) == name[:1]
@@ -187,7 +198,7 @@ var (
// filters out unwanted directory names and sanitizes remaining names. // filters out unwanted directory names and sanitizes remaining names.
func (ns *NameStrategy) filterDirs(path string) []string { func (ns *NameStrategy) filterDirs(path string) []string {
allDirs := strings.Split(path, string(filepath.Separator)) allDirs := strings.Split(path, GoSeperator)
dirs := make([]string, 0, len(allDirs)) dirs := make([]string, 0, len(allDirs))
for _, p := range allDirs { for _, p := range allDirs {
if ns.IgnoreWords == nil || !ns.IgnoreWords[p] { if ns.IgnoreWords == nil || !ns.IgnoreWords[p] {
+5 -4
View File
@@ -26,6 +26,7 @@ import (
"io/ioutil" "io/ioutil"
"os" "os"
"os/exec" "os/exec"
"path"
"path/filepath" "path/filepath"
"sort" "sort"
"strings" "strings"
@@ -226,12 +227,12 @@ func (b *Builder) AddDirRecursive(dir string) error {
// filepath.Walk includes the root dir, but we already did that, so we'll // filepath.Walk includes the root dir, but we already did that, so we'll
// remove that prefix and rebuild a package import path. // remove that prefix and rebuild a package import path.
prefix := b.buildPackages[dir].Dir prefix := b.buildPackages[dir].Dir
fn := func(path string, info os.FileInfo, err error) error { fn := func(filePath string, info os.FileInfo, err error) error {
if info != nil && info.IsDir() { if info != nil && info.IsDir() {
rel := strings.TrimPrefix(path, prefix) rel := filepath.ToSlash(strings.TrimPrefix(filePath, prefix))
if rel != "" { if rel != "" {
// Make a pkg path. // Make a pkg path.
pkg := filepath.Join(string(canonicalizeImportPath(b.buildPackages[dir].ImportPath)), rel) pkg := path.Join(string(canonicalizeImportPath(b.buildPackages[dir].ImportPath)), rel)
// Add it. // Add it.
if _, err := b.importPackage(pkg, true); err != nil { if _, err := b.importPackage(pkg, true); err != nil {
@@ -488,7 +489,7 @@ func (b *Builder) findTypesIn(pkgPath importPathString, u *types.Universe) error
u.Package(string(pkgPath)).SourcePath = b.absPaths[pkgPath] u.Package(string(pkgPath)).SourcePath = b.absPaths[pkgPath]
for _, f := range b.parsed[pkgPath] { for _, f := range b.parsed[pkgPath] {
if strings.HasSuffix(f.name, "/doc.go") { if _, fileName := filepath.Split(f.name); fileName == "doc.go" {
tp := u.Package(string(pkgPath)) tp := u.Package(string(pkgPath))
// findTypesIn might be called multiple times. Clean up tp.Comments // findTypesIn might be called multiple times. Clean up tp.Comments
// to avoid repeatedly fill same comments to it. // to avoid repeatedly fill same comments to it.