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
01097dba
Commit
01097dba
authored
Jul 16, 2017
by
Klaus Ma
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed nodeutil to v1node.
parent
269d7c3b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
nodecontroller.go
pkg/controller/node/nodecontroller.go
+7
-7
No files found.
pkg/controller/node/nodecontroller.go
View file @
01097dba
...
@@ -41,7 +41,7 @@ import (
...
@@ -41,7 +41,7 @@ import (
"k8s.io/api/core/v1"
"k8s.io/api/core/v1"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api"
v1helper
"k8s.io/kubernetes/pkg/api/v1/helper"
v1helper
"k8s.io/kubernetes/pkg/api/v1/helper"
nodeutil
"k8s.io/kubernetes/pkg/api/v1/node"
v1node
"k8s.io/kubernetes/pkg/api/v1/node"
"k8s.io/kubernetes/pkg/client/clientset_generated/clientset"
"k8s.io/kubernetes/pkg/client/clientset_generated/clientset"
coreinformers
"k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/core/v1"
coreinformers
"k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/core/v1"
extensionsinformers
"k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/extensions/v1beta1"
extensionsinformers
"k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/extensions/v1beta1"
...
@@ -453,7 +453,7 @@ func (nc *NodeController) doTaintingPass() {
...
@@ -453,7 +453,7 @@ func (nc *NodeController) doTaintingPass() {
zone
:=
utilnode
.
GetZoneKey
(
node
)
zone
:=
utilnode
.
GetZoneKey
(
node
)
EvictionsNumber
.
WithLabelValues
(
zone
)
.
Inc
()
EvictionsNumber
.
WithLabelValues
(
zone
)
.
Inc
()
}
}
_
,
condition
:=
nodeutil
.
GetNodeCondition
(
&
node
.
Status
,
v1
.
NodeReady
)
_
,
condition
:=
v1node
.
GetNodeCondition
(
&
node
.
Status
,
v1
.
NodeReady
)
// Because we want to mimic NodeStatus.Condition["Ready"] we make "unreachable" and "not ready" taints mutually exclusive.
// Because we want to mimic NodeStatus.Condition["Ready"] we make "unreachable" and "not ready" taints mutually exclusive.
taintToAdd
:=
v1
.
Taint
{}
taintToAdd
:=
v1
.
Taint
{}
oppositeTaint
:=
v1
.
Taint
{}
oppositeTaint
:=
v1
.
Taint
{}
...
@@ -839,7 +839,7 @@ func (nc *NodeController) tryUpdateNodeStatus(node *v1.Node) (time.Duration, v1.
...
@@ -839,7 +839,7 @@ func (nc *NodeController) tryUpdateNodeStatus(node *v1.Node) (time.Duration, v1.
var
err
error
var
err
error
var
gracePeriod
time
.
Duration
var
gracePeriod
time
.
Duration
var
observedReadyCondition
v1
.
NodeCondition
var
observedReadyCondition
v1
.
NodeCondition
_
,
currentReadyCondition
:=
nodeutil
.
GetNodeCondition
(
&
node
.
Status
,
v1
.
NodeReady
)
_
,
currentReadyCondition
:=
v1node
.
GetNodeCondition
(
&
node
.
Status
,
v1
.
NodeReady
)
if
currentReadyCondition
==
nil
{
if
currentReadyCondition
==
nil
{
// If ready condition is nil, then kubelet (or nodecontroller) never posted node status.
// If ready condition is nil, then kubelet (or nodecontroller) never posted node status.
// A fake ready condition is created, where LastProbeTime and LastTransitionTime is set
// A fake ready condition is created, where LastProbeTime and LastTransitionTime is set
...
@@ -879,9 +879,9 @@ func (nc *NodeController) tryUpdateNodeStatus(node *v1.Node) (time.Duration, v1.
...
@@ -879,9 +879,9 @@ func (nc *NodeController) tryUpdateNodeStatus(node *v1.Node) (time.Duration, v1.
// if that's the case, but it does not seem necessary.
// if that's the case, but it does not seem necessary.
var
savedCondition
*
v1
.
NodeCondition
var
savedCondition
*
v1
.
NodeCondition
if
found
{
if
found
{
_
,
savedCondition
=
nodeutil
.
GetNodeCondition
(
&
savedNodeStatus
.
status
,
v1
.
NodeReady
)
_
,
savedCondition
=
v1node
.
GetNodeCondition
(
&
savedNodeStatus
.
status
,
v1
.
NodeReady
)
}
}
_
,
observedCondition
:=
nodeutil
.
GetNodeCondition
(
&
node
.
Status
,
v1
.
NodeReady
)
_
,
observedCondition
:=
v1node
.
GetNodeCondition
(
&
node
.
Status
,
v1
.
NodeReady
)
if
!
found
{
if
!
found
{
glog
.
Warningf
(
"Missing timestamp for Node %s. Assuming now as a timestamp."
,
node
.
Name
)
glog
.
Warningf
(
"Missing timestamp for Node %s. Assuming now as a timestamp."
,
node
.
Name
)
savedNodeStatus
=
nodeStatusData
{
savedNodeStatus
=
nodeStatusData
{
...
@@ -958,7 +958,7 @@ func (nc *NodeController) tryUpdateNodeStatus(node *v1.Node) (time.Duration, v1.
...
@@ -958,7 +958,7 @@ func (nc *NodeController) tryUpdateNodeStatus(node *v1.Node) (time.Duration, v1.
remainingNodeConditionTypes
:=
[]
v1
.
NodeConditionType
{
v1
.
NodeOutOfDisk
,
v1
.
NodeMemoryPressure
,
v1
.
NodeDiskPressure
}
remainingNodeConditionTypes
:=
[]
v1
.
NodeConditionType
{
v1
.
NodeOutOfDisk
,
v1
.
NodeMemoryPressure
,
v1
.
NodeDiskPressure
}
nowTimestamp
:=
nc
.
now
()
nowTimestamp
:=
nc
.
now
()
for
_
,
nodeConditionType
:=
range
remainingNodeConditionTypes
{
for
_
,
nodeConditionType
:=
range
remainingNodeConditionTypes
{
_
,
currentCondition
:=
nodeutil
.
GetNodeCondition
(
&
node
.
Status
,
nodeConditionType
)
_
,
currentCondition
:=
v1node
.
GetNodeCondition
(
&
node
.
Status
,
nodeConditionType
)
if
currentCondition
==
nil
{
if
currentCondition
==
nil
{
glog
.
V
(
2
)
.
Infof
(
"Condition %v of node %v was never updated by kubelet"
,
nodeConditionType
,
node
.
Name
)
glog
.
V
(
2
)
.
Infof
(
"Condition %v of node %v was never updated by kubelet"
,
nodeConditionType
,
node
.
Name
)
node
.
Status
.
Conditions
=
append
(
node
.
Status
.
Conditions
,
v1
.
NodeCondition
{
node
.
Status
.
Conditions
=
append
(
node
.
Status
.
Conditions
,
v1
.
NodeCondition
{
...
@@ -981,7 +981,7 @@ func (nc *NodeController) tryUpdateNodeStatus(node *v1.Node) (time.Duration, v1.
...
@@ -981,7 +981,7 @@ func (nc *NodeController) tryUpdateNodeStatus(node *v1.Node) (time.Duration, v1.
}
}
}
}
_
,
currentCondition
:=
nodeutil
.
GetNodeCondition
(
&
node
.
Status
,
v1
.
NodeReady
)
_
,
currentCondition
:=
v1node
.
GetNodeCondition
(
&
node
.
Status
,
v1
.
NodeReady
)
if
!
apiequality
.
Semantic
.
DeepEqual
(
currentCondition
,
&
observedReadyCondition
)
{
if
!
apiequality
.
Semantic
.
DeepEqual
(
currentCondition
,
&
observedReadyCondition
)
{
if
_
,
err
=
nc
.
kubeClient
.
Core
()
.
Nodes
()
.
UpdateStatus
(
node
);
err
!=
nil
{
if
_
,
err
=
nc
.
kubeClient
.
Core
()
.
Nodes
()
.
UpdateStatus
(
node
);
err
!=
nil
{
glog
.
Errorf
(
"Error updating node %s: %v"
,
node
.
Name
,
err
)
glog
.
Errorf
(
"Error updating node %s: %v"
,
node
.
Name
,
err
)
...
...
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