Skip to content

Commit

Permalink
Merge pull request #683 from gnufied/fix-volume-loop-bug
Browse files Browse the repository at this point in the history
Bug 1951467: fix loop bug for verify attached volume
  • Loading branch information
openshift-merge-robot committed Apr 23, 2021
2 parents a5a0987 + 84316ee commit d856161
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 d856161

Please sign in to comment.