Skip to content

Commit

Permalink
fix: get disk stuck issue
Browse files Browse the repository at this point in the history
  • Loading branch information
andyzhangx committed Jan 3, 2025
1 parent 0de3521 commit a009c9b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/azuredisk/azuredisk.go
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,12 @@ func (d *Driver) checkDiskExists(ctx context.Context, diskURI string) (*armcompu
if err != nil {
return nil, err
}
disk, err := diskClient.Get(ctx, resourceGroup, diskName)

// get disk operation should timeout within 1min if it takes too long time
newCtx, cancel := context.WithTimeout(ctx, time.Minute)
defer cancel()

disk, err := diskClient.Get(newCtx, resourceGroup, diskName)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit a009c9b

Please sign in to comment.