Skip to content

Commit

Permalink
simon suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
chaireze committed Aug 7, 2023
1 parent 7be0427 commit 1135f3a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions pkg/blob/nodeserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -362,12 +362,10 @@ func (d *Driver) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRe
providedAuth := cv.NewBlobAuth(accountName, containerName, secretName, secretNamespace, storageAuthType)

err = annotator.SendProvisionVolume(pv, d.cloud.Config.AzureAuthConfig, providedAuth)
if err != nil {
if err == cv.ErrVolumeAlreadyBeingProvisioned {
klog.V(2).Infof("NodeStageVolume: volume has already been provisioned")
} else {
return nil, err
}
if err == cv.ErrVolumeAlreadyBeingProvisioned {
klog.V(2).Infof("NodeStageVolume: volume has already been provisioned")
} else if err != nil {
return nil, err
}

if err = d.edgeCacheManager.MountVolume(accountName, containerName, targetPath); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/edgecache/cachevolume/pvc_annotator.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ func (c *PVCAnnotator) SendProvisionVolume(pv *v1.PersistentVolume, cloudConfig
return err
}

if prepare := c.needsToBeProvisioned(pvc); !prepare {
if !c.needsToBeProvisioned(pvc) {
klog.Info("pv is already being provisioned")
return ErrVolumeAlreadyBeingProvisioned
}
Expand Down

0 comments on commit 1135f3a

Please sign in to comment.