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
91124afd
Commit
91124afd
authored
Feb 11, 2016
by
mqliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Sync pods for daemon sets."
This reverts commit
ffd34311
.
parent
d802778c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
40 deletions
+1
-40
controller.go
pkg/controller/daemon/controller.go
+1
-1
controller_test.go
pkg/controller/daemon/controller_test.go
+0
-39
No files found.
pkg/controller/daemon/controller.go
View file @
91124afd
...
@@ -187,7 +187,6 @@ func NewDaemonSetsController(kubeClient clientset.Interface, resyncPeriod contro
...
@@ -187,7 +187,6 @@ func NewDaemonSetsController(kubeClient clientset.Interface, resyncPeriod contro
func
(
dsc
*
DaemonSetsController
)
Run
(
workers
int
,
stopCh
<-
chan
struct
{})
{
func
(
dsc
*
DaemonSetsController
)
Run
(
workers
int
,
stopCh
<-
chan
struct
{})
{
defer
utilruntime
.
HandleCrash
()
defer
utilruntime
.
HandleCrash
()
glog
.
Infof
(
"Starting Daemon Sets controller manager"
)
glog
.
Infof
(
"Starting Daemon Sets controller manager"
)
controller
.
SyncAllPodsWithStore
(
dsc
.
kubeClient
,
dsc
.
podStore
.
Store
)
go
dsc
.
dsController
.
Run
(
stopCh
)
go
dsc
.
dsController
.
Run
(
stopCh
)
go
dsc
.
podController
.
Run
(
stopCh
)
go
dsc
.
podController
.
Run
(
stopCh
)
go
dsc
.
nodeController
.
Run
(
stopCh
)
go
dsc
.
nodeController
.
Run
(
stopCh
)
...
@@ -472,6 +471,7 @@ func storeDaemonSetStatus(dsClient unversioned_extensions.DaemonSetInterface, ds
...
@@ -472,6 +471,7 @@ func storeDaemonSetStatus(dsClient unversioned_extensions.DaemonSetInterface, ds
if
ds
.
Status
.
DesiredNumberScheduled
==
desiredNumberScheduled
&&
ds
.
Status
.
CurrentNumberScheduled
==
currentNumberScheduled
&&
ds
.
Status
.
NumberMisscheduled
==
numberMisscheduled
{
if
ds
.
Status
.
DesiredNumberScheduled
==
desiredNumberScheduled
&&
ds
.
Status
.
CurrentNumberScheduled
==
currentNumberScheduled
&&
ds
.
Status
.
NumberMisscheduled
==
numberMisscheduled
{
return
nil
return
nil
}
}
var
updateErr
,
getErr
error
var
updateErr
,
getErr
error
for
i
:=
0
;
i
<=
StatusUpdateRetries
;
i
++
{
for
i
:=
0
;
i
<=
StatusUpdateRetries
;
i
++
{
ds
.
Status
.
DesiredNumberScheduled
=
desiredNumberScheduled
ds
.
Status
.
DesiredNumberScheduled
=
desiredNumberScheduled
...
...
pkg/controller/daemon/controller_test.go
View file @
91124afd
...
@@ -18,7 +18,6 @@ package daemon
...
@@ -18,7 +18,6 @@ package daemon
import
(
import
(
"fmt"
"fmt"
"net/http/httptest"
"testing"
"testing"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api"
...
@@ -30,9 +29,7 @@ import (
...
@@ -30,9 +29,7 @@ import (
clientset
"k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset"
clientset
"k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset"
client
"k8s.io/kubernetes/pkg/client/unversioned"
client
"k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/controller"
"k8s.io/kubernetes/pkg/controller"
"k8s.io/kubernetes/pkg/runtime"
"k8s.io/kubernetes/pkg/securitycontext"
"k8s.io/kubernetes/pkg/securitycontext"
utiltesting
"k8s.io/kubernetes/pkg/util/testing"
)
)
var
(
var
(
...
@@ -457,39 +454,3 @@ func TestDSManagerNotReady(t *testing.T) {
...
@@ -457,39 +454,3 @@ func TestDSManagerNotReady(t *testing.T) {
manager
.
podStoreSynced
=
alwaysReady
manager
.
podStoreSynced
=
alwaysReady
syncAndValidateDaemonSets
(
t
,
manager
,
ds
,
podControl
,
1
,
0
)
syncAndValidateDaemonSets
(
t
,
manager
,
ds
,
podControl
,
1
,
0
)
}
}
func
TestDSManagerInit
(
t
*
testing
.
T
)
{
// Insert a stable daemon set and make sure we don't create an extra pod
// for the one node which already has a daemon after a simulated restart.
ds
:=
newDaemonSet
(
"test"
)
ds
.
Status
=
extensions
.
DaemonSetStatus
{
CurrentNumberScheduled
:
1
,
NumberMisscheduled
:
0
,
DesiredNumberScheduled
:
1
,
}
nodeName
:=
"only-node"
podList
:=
&
api
.
PodList
{
Items
:
[]
api
.
Pod
{
*
newPod
(
"podname"
,
nodeName
,
simpleDaemonSetLabel
),
}}
response
:=
runtime
.
EncodeOrDie
(
testapi
.
Default
.
Codec
(),
podList
)
fakeHandler
:=
utiltesting
.
FakeHandler
{
StatusCode
:
200
,
ResponseBody
:
response
,
}
testServer
:=
httptest
.
NewServer
(
&
fakeHandler
)
// TODO: Uncomment when fix #19254
// defer testServer.Close()
clientset
:=
clientset
.
NewForConfigOrDie
(
&
client
.
Config
{
Host
:
testServer
.
URL
,
ContentConfig
:
client
.
ContentConfig
{
GroupVersion
:
testapi
.
Default
.
GroupVersion
()}})
manager
:=
NewDaemonSetsController
(
clientset
,
controller
.
NoResyncPeriodFunc
)
manager
.
dsStore
.
Add
(
ds
)
manager
.
nodeStore
.
Add
(
newNode
(
nodeName
,
nil
))
manager
.
podStoreSynced
=
alwaysReady
controller
.
SyncAllPodsWithStore
(
manager
.
kubeClient
,
manager
.
podStore
.
Store
)
fakePodControl
:=
&
controller
.
FakePodControl
{}
manager
.
podControl
=
fakePodControl
manager
.
syncHandler
(
getKey
(
ds
,
t
))
validateSyncDaemonSets
(
t
,
fakePodControl
,
0
,
0
)
}
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