@@ -40,8 +40,8 @@ type ReasonCache struct {
40
40
cache * lru.Cache
41
41
}
42
42
43
- // Reason is the cached item in ReasonCache
44
- type reasonItem struct {
43
+ // ReasonItem is the cached item in ReasonCache
44
+ type ReasonItem struct {
45
45
Err error
46
46
Message string
47
47
}
@@ -64,7 +64,7 @@ func (c *ReasonCache) composeKey(uid types.UID, name string) string {
64
64
func (c * ReasonCache ) add (uid types.UID , name string , reason error , message string ) {
65
65
c .lock .Lock ()
66
66
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 })
68
68
}
69
69
70
70
// Update updates the reason cache with the SyncPodResult. Only SyncResult with
@@ -93,13 +93,13 @@ func (c *ReasonCache) Remove(uid types.UID, name string) {
93
93
// Get gets error reason from the cache. The return values are error reason, error message and
94
94
// whether an error reason is found in the cache. If no error reason is found, empty string will
95
95
// 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 ) {
97
97
c .lock .Lock ()
98
98
defer c .lock .Unlock ()
99
99
value , ok := c .cache .Get (c .composeKey (uid , name ))
100
100
if ! ok {
101
101
return nil , false
102
102
}
103
- info := value .(reasonItem )
103
+ info := value .(ReasonItem )
104
104
return & info , true
105
105
}
0 commit comments