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
bf20886f
Unverified
Commit
bf20886f
authored
Feb 14, 2019
by
Kubernetes Prow Robot
Committed by
GitHub
Feb 14, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #73990 from xichengliudui/fixlinterror
Fix golint failures pkg/kubelet/util/cache
parents
60943a7a
4c42d542
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
2 deletions
+2
-2
.golint_failures
hack/.golint_failures
+0
-1
object_cache.go
pkg/kubelet/util/cache/object_cache.go
+1
-0
object_cache_test.go
pkg/kubelet/util/cache/object_cache_test.go
+1
-1
No files found.
hack/.golint_failures
View file @
bf20886f
...
@@ -225,7 +225,6 @@ pkg/kubelet/status/testing
...
@@ -225,7 +225,6 @@ pkg/kubelet/status/testing
pkg/kubelet/sysctl
pkg/kubelet/sysctl
pkg/kubelet/types
pkg/kubelet/types
pkg/kubelet/util
pkg/kubelet/util
pkg/kubelet/util/cache
pkg/kubelet/util/pluginwatcher
pkg/kubelet/util/pluginwatcher
pkg/kubelet/util/queue
pkg/kubelet/util/queue
pkg/kubelet/util/sliceutils
pkg/kubelet/util/sliceutils
...
...
pkg/kubelet/util/cache/object_cache.go
View file @
bf20886f
...
@@ -75,6 +75,7 @@ func (c *ObjectCache) Get(key string) (interface{}, error) {
...
@@ -75,6 +75,7 @@ func (c *ObjectCache) Get(key string) (interface{}, error) {
return
value
.
(
objectEntry
)
.
obj
,
nil
return
value
.
(
objectEntry
)
.
obj
,
nil
}
}
// Add adds objectEntry by using a unique string as the key.
func
(
c
*
ObjectCache
)
Add
(
key
string
,
obj
interface
{})
error
{
func
(
c
*
ObjectCache
)
Add
(
key
string
,
obj
interface
{})
error
{
err
:=
c
.
cache
.
Add
(
objectEntry
{
key
:
key
,
obj
:
obj
})
err
:=
c
.
cache
.
Add
(
objectEntry
{
key
:
key
,
obj
:
obj
})
if
err
!=
nil
{
if
err
!=
nil
{
...
...
pkg/kubelet/util/cache/object_cache_test.go
View file @
bf20886f
...
@@ -46,7 +46,7 @@ func TestAddAndGet(t *testing.T) {
...
@@ -46,7 +46,7 @@ func TestAddAndGet(t *testing.T) {
val
:
"bar"
,
val
:
"bar"
,
}
}
objectCache
:=
NewFakeObjectCache
(
func
()
(
interface
{},
error
)
{
objectCache
:=
NewFakeObjectCache
(
func
()
(
interface
{},
error
)
{
return
nil
,
fmt
.
Errorf
(
"Unexpected Error: updater should never be called in this test
!
"
)
return
nil
,
fmt
.
Errorf
(
"Unexpected Error: updater should never be called in this test"
)
},
1
*
time
.
Hour
,
clock
.
NewFakeClock
(
time
.
Now
()))
},
1
*
time
.
Hour
,
clock
.
NewFakeClock
(
time
.
Now
()))
err
:=
objectCache
.
Add
(
testObj
.
key
,
testObj
.
val
)
err
:=
objectCache
.
Add
(
testObj
.
key
,
testObj
.
val
)
...
...
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