Skip to content

Commit

Permalink
UPSTREAM: 92692: fix loop bug for verify attached volume
Browse files Browse the repository at this point in the history
  • Loading branch information
Pingan2017 authored and damemi committed Jul 7, 2021
1 parent 67de33e commit e42f754
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions pkg/volume/util/operationexecutor/operation_executor.go
Expand Up @@ -704,6 +704,7 @@ func (oe *operationExecutor) VerifyVolumesAreAttached(
volumeSpecMapByPlugin := make(map[string]map[*volume.Spec]v1.UniqueVolumeName)

for node, nodeAttachedVolumes := range attachedVolumes {
needIndividualVerifyVolumes := []AttachedVolume{}
for _, volumeAttached := range nodeAttachedVolumes {
if volumeAttached.VolumeSpec == nil {
klog.Errorf("VerifyVolumesAreAttached: nil spec for volume %s", volumeAttached.VolumeName)
Expand Down Expand Up @@ -757,12 +758,12 @@ func (oe *operationExecutor) VerifyVolumesAreAttached(
volumeSpecMapByPlugin[pluginName] = volumeSpecMap
continue
}

// If node doesn't support Bulk volume polling it is best to poll individually
nodeError := oe.VerifyVolumesAreAttachedPerNode(nodeAttachedVolumes, node, actualStateOfWorld)
if nodeError != nil {
klog.Errorf("VerifyVolumesAreAttached failed for volumes %v, node %q with error %v", nodeAttachedVolumes, node, nodeError)
}
needIndividualVerifyVolumes = append(needIndividualVerifyVolumes, volumeAttached)
}
nodeError := oe.VerifyVolumesAreAttachedPerNode(needIndividualVerifyVolumes, node, actualStateOfWorld)
if nodeError != nil {
klog.Errorf("VerifyVolumesAreAttached failed for volumes %v, node %q with error %v", needIndividualVerifyVolumes, node, nodeError)
}
}

Expand Down

0 comments on commit e42f754

Please sign in to comment.