mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 15:05:20 +00:00
Refactor IntOrString into a new pkg
pkg/util/intstr is a cleaner encapsulation for this type and supporting functions. No behavioral change.
This commit is contained in:
@@ -26,7 +26,7 @@ import (
|
||||
unversioned "k8s.io/kubernetes/pkg/api/unversioned"
|
||||
conversion "k8s.io/kubernetes/pkg/conversion"
|
||||
runtime "k8s.io/kubernetes/pkg/runtime"
|
||||
util "k8s.io/kubernetes/pkg/util"
|
||||
intstr "k8s.io/kubernetes/pkg/util/intstr"
|
||||
inf "speter.net/go/exp/math/dec/inf"
|
||||
)
|
||||
|
||||
@@ -634,7 +634,7 @@ func deepCopy_v1_GlusterfsVolumeSource(in GlusterfsVolumeSource, out *GlusterfsV
|
||||
|
||||
func deepCopy_v1_HTTPGetAction(in HTTPGetAction, out *HTTPGetAction, c *conversion.Cloner) error {
|
||||
out.Path = in.Path
|
||||
if err := deepCopy_util_IntOrString(in.Port, &out.Port, c); err != nil {
|
||||
if err := deepCopy_intstr_IntOrString(in.Port, &out.Port, c); err != nil {
|
||||
return err
|
||||
}
|
||||
out.Host = in.Host
|
||||
@@ -2134,7 +2134,7 @@ func deepCopy_v1_ServicePort(in ServicePort, out *ServicePort, c *conversion.Clo
|
||||
out.Name = in.Name
|
||||
out.Protocol = in.Protocol
|
||||
out.Port = in.Port
|
||||
if err := deepCopy_util_IntOrString(in.TargetPort, &out.TargetPort, c); err != nil {
|
||||
if err := deepCopy_intstr_IntOrString(in.TargetPort, &out.TargetPort, c); err != nil {
|
||||
return err
|
||||
}
|
||||
out.NodePort = in.NodePort
|
||||
@@ -2191,7 +2191,7 @@ func deepCopy_v1_ServiceStatus(in ServiceStatus, out *ServiceStatus, c *conversi
|
||||
}
|
||||
|
||||
func deepCopy_v1_TCPSocketAction(in TCPSocketAction, out *TCPSocketAction, c *conversion.Cloner) error {
|
||||
if err := deepCopy_util_IntOrString(in.Port, &out.Port, c); err != nil {
|
||||
if err := deepCopy_intstr_IntOrString(in.Port, &out.Port, c); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
@@ -2356,8 +2356,8 @@ func deepCopy_runtime_RawExtension(in runtime.RawExtension, out *runtime.RawExte
|
||||
return nil
|
||||
}
|
||||
|
||||
func deepCopy_util_IntOrString(in util.IntOrString, out *util.IntOrString, c *conversion.Cloner) error {
|
||||
out.Kind = in.Kind
|
||||
func deepCopy_intstr_IntOrString(in intstr.IntOrString, out *intstr.IntOrString, c *conversion.Cloner) error {
|
||||
out.Type = in.Type
|
||||
out.IntVal = in.IntVal
|
||||
out.StrVal = in.StrVal
|
||||
return nil
|
||||
@@ -2489,7 +2489,7 @@ func init() {
|
||||
deepCopy_v1_VolumeMount,
|
||||
deepCopy_v1_VolumeSource,
|
||||
deepCopy_runtime_RawExtension,
|
||||
deepCopy_util_IntOrString,
|
||||
deepCopy_intstr_IntOrString,
|
||||
)
|
||||
if err != nil {
|
||||
// if one of the deep copy functions is malformed, detect it immediately.
|
||||
|
||||
Reference in New Issue
Block a user