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
b7ec333f
Commit
b7ec333f
authored
Jun 28, 2018
by
Michael Taufen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
port setNodeStatusDaemonEndpoints to Setter abstraction
parent
59bb2105
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
6 deletions
+9
-6
kubelet_node_status.go
pkg/kubelet/kubelet_node_status.go
+1
-6
setters.go
pkg/kubelet/nodestatus/setters.go
+8
-0
No files found.
pkg/kubelet/kubelet_node_status.go
View file @
b7ec333f
...
@@ -444,11 +444,6 @@ func (kl *Kubelet) recordEvent(eventType, event, message string) {
...
@@ -444,11 +444,6 @@ func (kl *Kubelet) recordEvent(eventType, event, message string) {
kl
.
recorder
.
Eventf
(
kl
.
nodeRef
,
eventType
,
event
,
message
)
kl
.
recorder
.
Eventf
(
kl
.
nodeRef
,
eventType
,
event
,
message
)
}
}
// Set daemonEndpoints for the node.
func
(
kl
*
Kubelet
)
setNodeStatusDaemonEndpoints
(
node
*
v1
.
Node
)
{
node
.
Status
.
DaemonEndpoints
=
*
kl
.
daemonEndpoints
}
// Set images list for the node
// Set images list for the node
func
(
kl
*
Kubelet
)
setNodeStatusImages
(
node
*
v1
.
Node
)
{
func
(
kl
*
Kubelet
)
setNodeStatusImages
(
node
*
v1
.
Node
)
{
// Update image list of this node
// Update image list of this node
...
@@ -549,7 +544,7 @@ func (kl *Kubelet) defaultNodeStatusFuncs() []func(*v1.Node) error {
...
@@ -549,7 +544,7 @@ func (kl *Kubelet) defaultNodeStatusFuncs() []func(*v1.Node) error {
nodestatus
.
MachineInfo
(
string
(
kl
.
nodeName
),
kl
.
maxPods
,
kl
.
podsPerCore
,
kl
.
GetCachedMachineInfo
,
kl
.
containerManager
.
GetCapacity
,
nodestatus
.
MachineInfo
(
string
(
kl
.
nodeName
),
kl
.
maxPods
,
kl
.
podsPerCore
,
kl
.
GetCachedMachineInfo
,
kl
.
containerManager
.
GetCapacity
,
kl
.
containerManager
.
GetDevicePluginResourceCapacity
,
kl
.
containerManager
.
GetNodeAllocatableReservation
,
kl
.
recordEvent
),
kl
.
containerManager
.
GetDevicePluginResourceCapacity
,
kl
.
containerManager
.
GetNodeAllocatableReservation
,
kl
.
recordEvent
),
nodestatus
.
VersionInfo
(
kl
.
cadvisor
.
VersionInfo
,
kl
.
containerRuntime
.
Type
,
kl
.
containerRuntime
.
Version
),
nodestatus
.
VersionInfo
(
kl
.
cadvisor
.
VersionInfo
,
kl
.
containerRuntime
.
Type
,
kl
.
containerRuntime
.
Version
),
withoutError
(
kl
.
setNodeStatusD
aemonEndpoints
),
nodestatus
.
DaemonEndpoints
(
kl
.
d
aemonEndpoints
),
withoutError
(
kl
.
setNodeStatusImages
),
withoutError
(
kl
.
setNodeStatusImages
),
withoutError
(
kl
.
setNodeStatusGoRuntime
),
withoutError
(
kl
.
setNodeStatusGoRuntime
),
)
)
...
...
pkg/kubelet/nodestatus/setters.go
View file @
b7ec333f
...
@@ -323,6 +323,14 @@ func VersionInfo(versionInfoFunc func() (*cadvisorapiv1.VersionInfo, error), //
...
@@ -323,6 +323,14 @@ func VersionInfo(versionInfoFunc func() (*cadvisorapiv1.VersionInfo, error), //
}
}
}
}
// DaemonEndpoints returns a Setter that updates the daemon endpoints on the node.
func
DaemonEndpoints
(
daemonEndpoints
*
v1
.
NodeDaemonEndpoints
)
Setter
{
return
func
(
node
*
v1
.
Node
)
error
{
node
.
Status
.
DaemonEndpoints
=
*
daemonEndpoints
return
nil
}
}
// ReadyCondition returns a Setter that updates the v1.NodeReady condition on the node.
// ReadyCondition returns a Setter that updates the v1.NodeReady condition on the node.
func
ReadyCondition
(
func
ReadyCondition
(
nowFunc
func
()
time
.
Time
,
// typically Kubelet.clock.Now
nowFunc
func
()
time
.
Time
,
// typically Kubelet.clock.Now
...
...
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