Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
ab58014c
Commit
ab58014c
authored
Mar 28, 2018
by
hzxuzhonghu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LoadBalancerStatus make use of generated deep copy method
parent
a5b12172
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
3 additions
and
15 deletions
+3
-15
helpers.go
pkg/apis/core/helper/helpers.go
+0
-10
BUILD
pkg/proxy/BUILD
+0
-1
service.go
pkg/proxy/service.go
+1
-2
proxier.go
pkg/proxy/userspace/proxier.go
+1
-1
proxier.go
pkg/proxy/winkernel/proxier.go
+1
-1
No files found.
pkg/apis/core/helper/helpers.go
View file @
ab58014c
...
@@ -326,16 +326,6 @@ func ingressEqual(lhs, rhs *core.LoadBalancerIngress) bool {
...
@@ -326,16 +326,6 @@ func ingressEqual(lhs, rhs *core.LoadBalancerIngress) bool {
return
true
return
true
}
}
// TODO: make method on LoadBalancerStatus?
func
LoadBalancerStatusDeepCopy
(
lb
*
core
.
LoadBalancerStatus
)
*
core
.
LoadBalancerStatus
{
c
:=
&
core
.
LoadBalancerStatus
{}
c
.
Ingress
=
make
([]
core
.
LoadBalancerIngress
,
len
(
lb
.
Ingress
))
for
i
:=
range
lb
.
Ingress
{
c
.
Ingress
[
i
]
=
lb
.
Ingress
[
i
]
}
return
c
}
// GetAccessModesAsString returns a string representation of an array of access modes.
// GetAccessModesAsString returns a string representation of an array of access modes.
// modes, when present, are always in the same order: RWO,ROX,RWX.
// modes, when present, are always in the same order: RWO,ROX,RWX.
func
GetAccessModesAsString
(
modes
[]
core
.
PersistentVolumeAccessMode
)
string
{
func
GetAccessModesAsString
(
modes
[]
core
.
PersistentVolumeAccessMode
)
string
{
...
...
pkg/proxy/BUILD
View file @
ab58014c
...
@@ -18,7 +18,6 @@ go_library(
...
@@ -18,7 +18,6 @@ go_library(
deps = [
deps = [
"//pkg/api/service:go_default_library",
"//pkg/api/service:go_default_library",
"//pkg/apis/core:go_default_library",
"//pkg/apis/core:go_default_library",
"//pkg/apis/core/helper:go_default_library",
"//pkg/proxy/util:go_default_library",
"//pkg/proxy/util:go_default_library",
"//pkg/util/net:go_default_library",
"//pkg/util/net:go_default_library",
"//vendor/github.com/golang/glog:go_default_library",
"//vendor/github.com/golang/glog:go_default_library",
...
...
pkg/proxy/service.go
View file @
ab58014c
...
@@ -30,7 +30,6 @@ import (
...
@@ -30,7 +30,6 @@ import (
"k8s.io/client-go/tools/record"
"k8s.io/client-go/tools/record"
apiservice
"k8s.io/kubernetes/pkg/api/service"
apiservice
"k8s.io/kubernetes/pkg/api/service"
api
"k8s.io/kubernetes/pkg/apis/core"
api
"k8s.io/kubernetes/pkg/apis/core"
"k8s.io/kubernetes/pkg/apis/core/helper"
utilproxy
"k8s.io/kubernetes/pkg/proxy/util"
utilproxy
"k8s.io/kubernetes/pkg/proxy/util"
utilnet
"k8s.io/kubernetes/pkg/util/net"
utilnet
"k8s.io/kubernetes/pkg/util/net"
)
)
...
@@ -91,7 +90,7 @@ func (sct *ServiceChangeTracker) newBaseServiceInfo(port *api.ServicePort, servi
...
@@ -91,7 +90,7 @@ func (sct *ServiceChangeTracker) newBaseServiceInfo(port *api.ServicePort, servi
Protocol
:
port
.
Protocol
,
Protocol
:
port
.
Protocol
,
NodePort
:
int
(
port
.
NodePort
),
NodePort
:
int
(
port
.
NodePort
),
// Deep-copy in case the service instance changes
// Deep-copy in case the service instance changes
LoadBalancerStatus
:
*
helper
.
LoadBalancerStatusDeepCopy
(
&
service
.
Status
.
LoadBalancer
),
LoadBalancerStatus
:
*
service
.
Status
.
LoadBalancer
.
DeepCopy
(
),
SessionAffinityType
:
service
.
Spec
.
SessionAffinity
,
SessionAffinityType
:
service
.
Spec
.
SessionAffinity
,
StickyMaxAgeSeconds
:
stickyMaxAgeSeconds
,
StickyMaxAgeSeconds
:
stickyMaxAgeSeconds
,
OnlyNodeLocalEndpoints
:
onlyNodeLocalEndpoints
,
OnlyNodeLocalEndpoints
:
onlyNodeLocalEndpoints
,
...
...
pkg/proxy/userspace/proxier.go
View file @
ab58014c
...
@@ -447,7 +447,7 @@ func (proxier *Proxier) mergeService(service *api.Service) sets.String {
...
@@ -447,7 +447,7 @@ func (proxier *Proxier) mergeService(service *api.Service) sets.String {
info
.
portal
.
port
=
int
(
servicePort
.
Port
)
info
.
portal
.
port
=
int
(
servicePort
.
Port
)
info
.
externalIPs
=
service
.
Spec
.
ExternalIPs
info
.
externalIPs
=
service
.
Spec
.
ExternalIPs
// Deep-copy in case the service instance changes
// Deep-copy in case the service instance changes
info
.
loadBalancerStatus
=
*
helper
.
LoadBalancerStatusDeepCopy
(
&
service
.
Status
.
LoadBalancer
)
info
.
loadBalancerStatus
=
*
service
.
Status
.
LoadBalancer
.
DeepCopy
(
)
info
.
nodePort
=
int
(
servicePort
.
NodePort
)
info
.
nodePort
=
int
(
servicePort
.
NodePort
)
info
.
sessionAffinityType
=
service
.
Spec
.
SessionAffinity
info
.
sessionAffinityType
=
service
.
Spec
.
SessionAffinity
// Kube-apiserver side guarantees SessionAffinityConfig won't be nil when session affinity type is ClientIP
// Kube-apiserver side guarantees SessionAffinityConfig won't be nil when session affinity type is ClientIP
...
...
pkg/proxy/winkernel/proxier.go
View file @
ab58014c
...
@@ -175,7 +175,7 @@ func newServiceInfo(svcPortName proxy.ServicePortName, port *api.ServicePort, se
...
@@ -175,7 +175,7 @@ func newServiceInfo(svcPortName proxy.ServicePortName, port *api.ServicePort, se
nodePort
:
int
(
port
.
NodePort
),
nodePort
:
int
(
port
.
NodePort
),
targetPort
:
port
.
TargetPort
.
IntValue
(),
targetPort
:
port
.
TargetPort
.
IntValue
(),
// Deep-copy in case the service instance changes
// Deep-copy in case the service instance changes
loadBalancerStatus
:
*
helper
.
LoadBalancerStatusDeepCopy
(
&
service
.
Status
.
LoadBalancer
),
loadBalancerStatus
:
*
service
.
Status
.
LoadBalancer
.
DeepCopy
(
),
sessionAffinityType
:
service
.
Spec
.
SessionAffinity
,
sessionAffinityType
:
service
.
Spec
.
SessionAffinity
,
stickyMaxAgeSeconds
:
stickyMaxAgeSeconds
,
stickyMaxAgeSeconds
:
stickyMaxAgeSeconds
,
loadBalancerSourceRanges
:
make
([]
string
,
len
(
service
.
Spec
.
LoadBalancerSourceRanges
)),
loadBalancerSourceRanges
:
make
([]
string
,
len
(
service
.
Spec
.
LoadBalancerSourceRanges
)),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment