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
c048e6fc
Commit
c048e6fc
authored
Apr 04, 2015
by
David Oppenheimer
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6443 from davidopp/master
Remove use of events from NodeController, to temporarily fix #6199
parents
dbd7b186
c4a595aa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
32 deletions
+0
-32
nodecontroller.go
pkg/cloudprovider/controller/nodecontroller.go
+0
-32
No files found.
pkg/cloudprovider/controller/nodecontroller.go
View file @
c048e6fc
...
@@ -27,11 +27,9 @@ import (
...
@@ -27,11 +27,9 @@ import (
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
apierrors
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/errors"
apierrors
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/errors"
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
"github.com/GoogleCloudPlatform/kubernetes/pkg/client/record"
"github.com/GoogleCloudPlatform/kubernetes/pkg/cloudprovider"
"github.com/GoogleCloudPlatform/kubernetes/pkg/cloudprovider"
"github.com/GoogleCloudPlatform/kubernetes/pkg/labels"
"github.com/GoogleCloudPlatform/kubernetes/pkg/labels"
"github.com/GoogleCloudPlatform/kubernetes/pkg/probe"
"github.com/GoogleCloudPlatform/kubernetes/pkg/probe"
"github.com/GoogleCloudPlatform/kubernetes/pkg/types"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
"github.com/golang/glog"
"github.com/golang/glog"
)
)
...
@@ -77,7 +75,6 @@ type NodeController struct {
...
@@ -77,7 +75,6 @@ type NodeController struct {
nodes
[]
string
nodes
[]
string
kubeClient
client
.
Interface
kubeClient
client
.
Interface
kubeletClient
client
.
KubeletClient
kubeletClient
client
.
KubeletClient
recorder
record
.
EventRecorder
registerRetryCount
int
registerRetryCount
int
podEvictionTimeout
time
.
Duration
podEvictionTimeout
time
.
Duration
deletingPodsRateLimiter
util
.
RateLimiter
deletingPodsRateLimiter
util
.
RateLimiter
...
@@ -98,14 +95,6 @@ func NewNodeController(
...
@@ -98,14 +95,6 @@ func NewNodeController(
registerRetryCount
int
,
registerRetryCount
int
,
podEvictionTimeout
time
.
Duration
,
podEvictionTimeout
time
.
Duration
,
deletingPodsRateLimiter
util
.
RateLimiter
)
*
NodeController
{
deletingPodsRateLimiter
util
.
RateLimiter
)
*
NodeController
{
eventBroadcaster
:=
record
.
NewBroadcaster
()
recorder
:=
eventBroadcaster
.
NewRecorder
(
api
.
EventSource
{
Component
:
"controllermanager"
})
if
kubeClient
!=
nil
{
glog
.
Infof
(
"Sending events to api server."
)
eventBroadcaster
.
StartRecordingToSink
(
kubeClient
.
Events
(
""
))
}
else
{
glog
.
Infof
(
"No api server defined - no events will be sent to API server."
)
}
return
&
NodeController
{
return
&
NodeController
{
cloud
:
cloud
,
cloud
:
cloud
,
matchRE
:
matchRE
,
matchRE
:
matchRE
,
...
@@ -113,7 +102,6 @@ func NewNodeController(
...
@@ -113,7 +102,6 @@ func NewNodeController(
staticResources
:
staticResources
,
staticResources
:
staticResources
,
kubeClient
:
kubeClient
,
kubeClient
:
kubeClient
,
kubeletClient
:
kubeletClient
,
kubeletClient
:
kubeletClient
,
recorder
:
recorder
,
registerRetryCount
:
registerRetryCount
,
registerRetryCount
:
registerRetryCount
,
podEvictionTimeout
:
podEvictionTimeout
,
podEvictionTimeout
:
podEvictionTimeout
,
deletingPodsRateLimiter
:
deletingPodsRateLimiter
,
deletingPodsRateLimiter
:
deletingPodsRateLimiter
,
...
@@ -338,9 +326,6 @@ func (nc *NodeController) DoCheck(node *api.Node) []api.NodeCondition {
...
@@ -338,9 +326,6 @@ func (nc *NodeController) DoCheck(node *api.Node) []api.NodeCondition {
// status. Keep listing pods to sanity check if pods are all deleted makes more sense.
// status. Keep listing pods to sanity check if pods are all deleted makes more sense.
nc
.
deletePods
(
node
.
Name
)
nc
.
deletePods
(
node
.
Name
)
}
}
if
oldReadyCondition
!=
nil
&&
oldReadyCondition
.
Status
==
api
.
ConditionTrue
{
nc
.
recordNodeOfflineEvent
(
node
)
}
}
}
conditions
=
append
(
conditions
,
*
newReadyCondition
)
conditions
=
append
(
conditions
,
*
newReadyCondition
)
...
@@ -451,19 +436,6 @@ func (nc *NodeController) PopulateAddresses(nodes *api.NodeList) (*api.NodeList,
...
@@ -451,19 +436,6 @@ func (nc *NodeController) PopulateAddresses(nodes *api.NodeList) (*api.NodeList,
return
nodes
,
nil
return
nodes
,
nil
}
}
func
(
nc
*
NodeController
)
recordNodeOfflineEvent
(
node
*
api
.
Node
)
{
ref
:=
&
api
.
ObjectReference
{
Kind
:
"Node"
,
Name
:
node
.
Name
,
UID
:
types
.
UID
(
node
.
Name
),
Namespace
:
""
,
}
glog
.
V
(
2
)
.
Infof
(
"Recording offline event message for node %s"
,
node
.
Name
)
// TODO: This requires a transaction, either both node status is updated
// and event is recorded or neither should happen, see issue #6055.
nc
.
recorder
.
Eventf
(
ref
,
"offline"
,
"Node %s is now offline"
,
node
.
Name
)
}
func
(
nc
NodeController
)
tryUpdateNodeStatus
(
node
*
api
.
Node
)
(
error
,
time
.
Duration
,
api
.
NodeCondition
)
{
func
(
nc
NodeController
)
tryUpdateNodeStatus
(
node
*
api
.
Node
)
(
error
,
time
.
Duration
,
api
.
NodeCondition
)
{
var
err
error
var
err
error
var
gracePeriod
time
.
Duration
var
gracePeriod
time
.
Duration
...
@@ -509,10 +481,6 @@ func (nc NodeController) tryUpdateNodeStatus(node *api.Node) (error, time.Durati
...
@@ -509,10 +481,6 @@ func (nc NodeController) tryUpdateNodeStatus(node *api.Node) (error, time.Durati
readyCondition
.
LastProbeTime
=
lastReadyCondition
.
LastProbeTime
readyCondition
.
LastProbeTime
=
lastReadyCondition
.
LastProbeTime
readyCondition
.
LastTransitionTime
=
nc
.
now
()
readyCondition
.
LastTransitionTime
=
nc
.
now
()
}
}
if
readyCondition
.
Status
!=
api
.
ConditionTrue
&&
lastReadyCondition
.
Status
==
api
.
ConditionTrue
{
nc
.
recordNodeOfflineEvent
(
node
)
}
}
}
_
,
err
=
nc
.
kubeClient
.
Nodes
()
.
Update
(
node
)
_
,
err
=
nc
.
kubeClient
.
Nodes
()
.
Update
(
node
)
if
err
!=
nil
{
if
err
!=
nil
{
...
...
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