Skip to content

Commit 252a7ec

Browse files
authored
Merge pull request kubernetes#82233 from SataQiu/fix-golint-kubelet
Fix golint failures of pkg/kubelet
2 parents 51e9ff8 + 6d6b0be commit 252a7ec

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

hack/.golint_failures

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ pkg/kubeapiserver
110110
pkg/kubeapiserver/options
111111
pkg/kubectl/cmd/convert
112112
pkg/kubectl/cmd/get
113-
pkg/kubelet
114113
pkg/kubelet/apis/config
115114
pkg/kubelet/apis/config/v1beta1
116115
pkg/kubelet/apis/deviceplugin/v1beta1

pkg/kubelet/reason_cache.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ type ReasonCache struct {
4040
cache *lru.Cache
4141
}
4242

43-
// Reason is the cached item in ReasonCache
44-
type reasonItem struct {
43+
// ReasonItem is the cached item in ReasonCache
44+
type ReasonItem struct {
4545
Err error
4646
Message string
4747
}
@@ -64,7 +64,7 @@ func (c *ReasonCache) composeKey(uid types.UID, name string) string {
6464
func (c *ReasonCache) add(uid types.UID, name string, reason error, message string) {
6565
c.lock.Lock()
6666
defer c.lock.Unlock()
67-
c.cache.Add(c.composeKey(uid, name), reasonItem{reason, message})
67+
c.cache.Add(c.composeKey(uid, name), ReasonItem{reason, message})
6868
}
6969

7070
// Update updates the reason cache with the SyncPodResult. Only SyncResult with
@@ -93,13 +93,13 @@ func (c *ReasonCache) Remove(uid types.UID, name string) {
9393
// Get gets error reason from the cache. The return values are error reason, error message and
9494
// whether an error reason is found in the cache. If no error reason is found, empty string will
9595
// be returned for error reason and error message.
96-
func (c *ReasonCache) Get(uid types.UID, name string) (*reasonItem, bool) {
96+
func (c *ReasonCache) Get(uid types.UID, name string) (*ReasonItem, bool) {
9797
c.lock.Lock()
9898
defer c.lock.Unlock()
9999
value, ok := c.cache.Get(c.composeKey(uid, name))
100100
if !ok {
101101
return nil, false
102102
}
103-
info := value.(reasonItem)
103+
info := value.(ReasonItem)
104104
return &info, true
105105
}

0 commit comments

Comments
 (0)