Deflake TestUpdateNodeStatusWithLease - guard cached machineInfo
This commit is contained in:
@@ -382,5 +382,13 @@ func (kl *Kubelet) GetVersionInfo() (*cadvisorapiv1.VersionInfo, error) {
|
||||
|
||||
// GetCachedMachineInfo assumes that the machine info can't change without a reboot
|
||||
func (kl *Kubelet) GetCachedMachineInfo() (*cadvisorapiv1.MachineInfo, error) {
|
||||
kl.machineInfoLock.RLock()
|
||||
defer kl.machineInfoLock.RUnlock()
|
||||
return kl.machineInfo, nil
|
||||
}
|
||||
|
||||
func (kl *Kubelet) setCachedMachineInfo(info *cadvisorapiv1.MachineInfo) {
|
||||
kl.machineInfoLock.Lock()
|
||||
defer kl.machineInfoLock.Unlock()
|
||||
kl.machineInfo = info
|
||||
}
|
||||
|
Reference in New Issue
Block a user