mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 04:06:03 +00:00
Merge pull request #78105 from cwdsuzhou/narrow_down_lock
Narrow down the lock
This commit is contained in:
commit
5777fdfe31
@ -277,9 +277,6 @@ func (asw *actualStateOfWorld) AddVolumeToReportAsAttached(
|
||||
|
||||
func (asw *actualStateOfWorld) AddVolumeNode(
|
||||
uniqueName v1.UniqueVolumeName, volumeSpec *volume.Spec, nodeName types.NodeName, devicePath string, isAttached bool) (v1.UniqueVolumeName, error) {
|
||||
asw.Lock()
|
||||
defer asw.Unlock()
|
||||
|
||||
volumeName := uniqueName
|
||||
if volumeName == "" {
|
||||
if volumeSpec == nil {
|
||||
@ -306,6 +303,9 @@ func (asw *actualStateOfWorld) AddVolumeNode(
|
||||
}
|
||||
}
|
||||
|
||||
asw.Lock()
|
||||
defer asw.Unlock()
|
||||
|
||||
volumeObj, volumeExists := asw.attachedVolumes[volumeName]
|
||||
if !volumeExists {
|
||||
volumeObj = attachedVolume{
|
||||
|
@ -102,7 +102,7 @@ type DesiredStateOfWorld interface {
|
||||
// mounted and attached for terminated pods
|
||||
GetKeepTerminatedPodVolumesForNode(k8stypes.NodeName) bool
|
||||
|
||||
// Mark multiattach error as reported to prevent spamming multiple
|
||||
// Mark multi-attach error as reported to prevent spamming multiple
|
||||
// events for same error
|
||||
SetMultiAttachError(v1.UniqueVolumeName, k8stypes.NodeName)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user