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
0d179764
Unverified
Commit
0d179764
authored
Oct 23, 2018
by
k8s-ci-robot
Committed by
GitHub
Oct 23, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #70076 from feiskyer/named-port
Fix service targetPort with string for Windows
parents
3905fb66
4b7a502c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
4 deletions
+14
-4
proxier.go
pkg/proxy/winkernel/proxier.go
+14
-4
No files found.
pkg/proxy/winkernel/proxier.go
View file @
0d179764
...
...
@@ -180,10 +180,12 @@ func newServiceInfo(svcPortName proxy.ServicePortName, port *v1.ServicePort, ser
stickyMaxAgeSeconds
=
int
(
*
service
.
Spec
.
SessionAffinityConfig
.
ClientIP
.
TimeoutSeconds
)
}
info
:=
&
serviceInfo
{
clusterIP
:
net
.
ParseIP
(
service
.
Spec
.
ClusterIP
),
port
:
int
(
port
.
Port
),
protocol
:
port
.
Protocol
,
nodePort
:
int
(
port
.
NodePort
),
clusterIP
:
net
.
ParseIP
(
service
.
Spec
.
ClusterIP
),
port
:
int
(
port
.
Port
),
protocol
:
port
.
Protocol
,
nodePort
:
int
(
port
.
NodePort
),
// targetPort is zero if it is specified as a name in port.TargetPort.
// Its real value would be got later from endpoints.
targetPort
:
port
.
TargetPort
.
IntValue
(),
// Deep-copy in case the service instance changes
loadBalancerStatus
:
*
service
.
Status
.
LoadBalancer
.
DeepCopy
(),
...
...
@@ -977,6 +979,14 @@ func (proxier *Proxier) syncProxyRules() {
var
newHnsEndpoint
*
hcsshim
.
HNSEndpoint
hnsNetworkName
:=
proxier
.
network
.
name
var
err
error
// targetPort is zero if it is specified as a name in port.TargetPort, so the real port should be got from endpoints.
// Note that hcsshim.AddLoadBalancer() doesn't support endpoints with different ports, so only port from first endpoint is used.
// TODO(feiskyer): add support of different endpoint ports after hcsshim.AddLoadBalancer() add that.
if
svcInfo
.
targetPort
==
0
{
svcInfo
.
targetPort
=
int
(
ep
.
port
)
}
if
len
(
ep
.
hnsID
)
>
0
{
newHnsEndpoint
,
err
=
hcsshim
.
GetHNSEndpointByID
(
ep
.
hnsID
)
}
...
...
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