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
7828e5d0
Unverified
Commit
7828e5d0
authored
Jun 28, 2018
by
Jordan Liggitt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make cloud provider authoritative for node status address reporting
parent
db9d3c2d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
14 deletions
+4
-14
kubelet_node_status.go
pkg/kubelet/kubelet_node_status.go
+4
-14
No files found.
pkg/kubelet/kubelet_node_status.go
View file @
7828e5d0
...
@@ -494,20 +494,10 @@ func (kl *Kubelet) setNodeAddress(node *v1.Node) error {
...
@@ -494,20 +494,10 @@ func (kl *Kubelet) setNodeAddress(node *v1.Node) error {
return
fmt
.
Errorf
(
"failed to get node address from cloud provider that matches ip: %v"
,
kl
.
nodeIP
)
return
fmt
.
Errorf
(
"failed to get node address from cloud provider that matches ip: %v"
,
kl
.
nodeIP
)
}
}
// Only add a NodeHostName address if the cloudprovider did not specify one
// Only add a NodeHostName address if the cloudprovider did not specify any addresses.
// (we assume the cloudprovider knows best)
// (we assume the cloudprovider is authoritative if it specifies any addresses)
var
addressNodeHostName
*
v1
.
NodeAddress
if
len
(
nodeAddresses
)
==
0
{
for
i
:=
range
nodeAddresses
{
nodeAddresses
=
[]
v1
.
NodeAddress
{{
Type
:
v1
.
NodeHostName
,
Address
:
kl
.
GetHostname
()}}
if
nodeAddresses
[
i
]
.
Type
==
v1
.
NodeHostName
{
addressNodeHostName
=
&
nodeAddresses
[
i
]
break
}
}
if
addressNodeHostName
==
nil
{
hostnameAddress
:=
v1
.
NodeAddress
{
Type
:
v1
.
NodeHostName
,
Address
:
kl
.
GetHostname
()}
nodeAddresses
=
append
(
nodeAddresses
,
hostnameAddress
)
}
else
{
glog
.
V
(
2
)
.
Infof
(
"Using Node Hostname from cloudprovider: %q"
,
addressNodeHostName
.
Address
)
}
}
node
.
Status
.
Addresses
=
nodeAddresses
node
.
Status
.
Addresses
=
nodeAddresses
}
else
{
}
else
{
...
...
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