mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 23:17:50 +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:
@@ -25,7 +25,7 @@ import (
|
||||
resource "k8s.io/kubernetes/pkg/api/resource"
|
||||
unversioned "k8s.io/kubernetes/pkg/api/unversioned"
|
||||
conversion "k8s.io/kubernetes/pkg/conversion"
|
||||
util "k8s.io/kubernetes/pkg/util"
|
||||
intstr "k8s.io/kubernetes/pkg/util/intstr"
|
||||
inf "speter.net/go/exp/math/dec/inf"
|
||||
)
|
||||
|
||||
@@ -302,7 +302,7 @@ func deepCopy_api_GlusterfsVolumeSource(in api.GlusterfsVolumeSource, out *api.G
|
||||
|
||||
func deepCopy_api_HTTPGetAction(in api.HTTPGetAction, out *api.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
|
||||
@@ -695,7 +695,7 @@ func deepCopy_api_SecurityContext(in api.SecurityContext, out *api.SecurityConte
|
||||
}
|
||||
|
||||
func deepCopy_api_TCPSocketAction(in api.TCPSocketAction, out *api.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
|
||||
@@ -1205,7 +1205,7 @@ func deepCopy_extensions_Ingress(in Ingress, out *Ingress, c *conversion.Cloner)
|
||||
|
||||
func deepCopy_extensions_IngressBackend(in IngressBackend, out *IngressBackend, c *conversion.Cloner) error {
|
||||
out.ServiceName = in.ServiceName
|
||||
if err := deepCopy_util_IntOrString(in.ServicePort, &out.ServicePort, c); err != nil {
|
||||
if err := deepCopy_intstr_IntOrString(in.ServicePort, &out.ServicePort, c); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
@@ -1440,10 +1440,10 @@ func deepCopy_extensions_ReplicationControllerDummy(in ReplicationControllerDumm
|
||||
}
|
||||
|
||||
func deepCopy_extensions_RollingUpdateDeployment(in RollingUpdateDeployment, out *RollingUpdateDeployment, c *conversion.Cloner) error {
|
||||
if err := deepCopy_util_IntOrString(in.MaxUnavailable, &out.MaxUnavailable, c); err != nil {
|
||||
if err := deepCopy_intstr_IntOrString(in.MaxUnavailable, &out.MaxUnavailable, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := deepCopy_util_IntOrString(in.MaxSurge, &out.MaxSurge, c); err != nil {
|
||||
if err := deepCopy_intstr_IntOrString(in.MaxSurge, &out.MaxSurge, c); err != nil {
|
||||
return err
|
||||
}
|
||||
out.MinReadySeconds = in.MinReadySeconds
|
||||
@@ -1571,8 +1571,8 @@ func deepCopy_extensions_ThirdPartyResourceList(in ThirdPartyResourceList, out *
|
||||
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
|
||||
@@ -1671,7 +1671,7 @@ func init() {
|
||||
deepCopy_extensions_ThirdPartyResourceData,
|
||||
deepCopy_extensions_ThirdPartyResourceDataList,
|
||||
deepCopy_extensions_ThirdPartyResourceList,
|
||||
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