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
45269bef
Commit
45269bef
authored
Oct 08, 2015
by
mqliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
return api.DaemonSetList, instead of an array
parent
877bfa6d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
6 deletions
+8
-6
listers.go
pkg/client/cache/listers.go
+2
-2
listers_test.go
pkg/client/cache/listers_test.go
+4
-2
controller.go
pkg/controller/daemon/controller.go
+2
-2
No files found.
pkg/client/cache/listers.go
View file @
45269bef
...
@@ -242,9 +242,9 @@ func (s *StoreToDaemonSetLister) Exists(ds *extensions.DaemonSet) (bool, error)
...
@@ -242,9 +242,9 @@ func (s *StoreToDaemonSetLister) Exists(ds *extensions.DaemonSet) (bool, error)
// List lists all daemon sets in the store.
// List lists all daemon sets in the store.
// TODO: converge on the interface in pkg/client
// TODO: converge on the interface in pkg/client
func
(
s
*
StoreToDaemonSetLister
)
List
()
(
dss
[]
extensions
.
DaemonSe
t
,
err
error
)
{
func
(
s
*
StoreToDaemonSetLister
)
List
()
(
dss
extensions
.
DaemonSetLis
t
,
err
error
)
{
for
_
,
c
:=
range
s
.
Store
.
List
()
{
for
_
,
c
:=
range
s
.
Store
.
List
()
{
dss
=
append
(
ds
s
,
*
(
c
.
(
*
extensions
.
DaemonSet
)))
dss
.
Items
=
append
(
dss
.
Item
s
,
*
(
c
.
(
*
extensions
.
DaemonSet
)))
}
}
return
dss
,
nil
return
dss
,
nil
}
}
...
...
pkg/client/cache/listers_test.go
View file @
45269bef
...
@@ -171,7 +171,8 @@ func TestStoreToDaemonSetLister(t *testing.T) {
...
@@ -171,7 +171,8 @@ func TestStoreToDaemonSetLister(t *testing.T) {
{
ObjectMeta
:
api
.
ObjectMeta
{
Name
:
"basic"
}},
{
ObjectMeta
:
api
.
ObjectMeta
{
Name
:
"basic"
}},
},
},
list
:
func
()
([]
extensions
.
DaemonSet
,
error
)
{
list
:
func
()
([]
extensions
.
DaemonSet
,
error
)
{
return
lister
.
List
()
list
,
err
:=
lister
.
List
()
return
list
.
Items
,
err
},
},
outDaemonSetNames
:
sets
.
NewString
(
"basic"
),
outDaemonSetNames
:
sets
.
NewString
(
"basic"
),
},
},
...
@@ -183,7 +184,8 @@ func TestStoreToDaemonSetLister(t *testing.T) {
...
@@ -183,7 +184,8 @@ func TestStoreToDaemonSetLister(t *testing.T) {
{
ObjectMeta
:
api
.
ObjectMeta
{
Name
:
"complex2"
}},
{
ObjectMeta
:
api
.
ObjectMeta
{
Name
:
"complex2"
}},
},
},
list
:
func
()
([]
extensions
.
DaemonSet
,
error
)
{
list
:
func
()
([]
extensions
.
DaemonSet
,
error
)
{
return
lister
.
List
()
list
,
err
:=
lister
.
List
()
return
list
.
Items
,
err
},
},
outDaemonSetNames
:
sets
.
NewString
(
"basic"
,
"complex"
,
"complex2"
),
outDaemonSetNames
:
sets
.
NewString
(
"basic"
,
"complex"
,
"complex2"
),
},
},
...
...
pkg/controller/daemon/controller.go
View file @
45269bef
...
@@ -202,8 +202,8 @@ func (dsc *DaemonSetsController) enqueueAllDaemonSets() {
...
@@ -202,8 +202,8 @@ func (dsc *DaemonSetsController) enqueueAllDaemonSets() {
glog
.
Errorf
(
"Error enqueueing daemon sets: %v"
,
err
)
glog
.
Errorf
(
"Error enqueueing daemon sets: %v"
,
err
)
return
return
}
}
for
i
:=
range
ds
{
for
i
:=
range
ds
.
Items
{
dsc
.
enqueueDaemonSet
(
&
ds
[
i
])
dsc
.
enqueueDaemonSet
(
&
ds
.
Items
[
i
])
}
}
}
}
...
...
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