Skip to content

Commit

Permalink
set timeout in timeout
Browse files Browse the repository at this point in the history
Signed-off-by: zwwhdls <[email protected]>
  • Loading branch information
zwwhdls committed Sep 24, 2024
1 parent 4808231 commit 23f1662
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/controller/pod_driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,10 @@ func (p *PodDriver) recoverTarget(ctx context.Context, podName, sourcePath strin
}
log.Info("recover volPath", "target", ti.target, "mountPath", sourcePath)
mountOption := []string{"bind"}
if err := p.Mount(sourcePath, ti.target, "none", mountOption); err != nil {
err = util.DoWithTimeout(ctx, defaultCheckoutTimeout, func() error {
return p.Mount(sourcePath, ti.target, "none", mountOption)
})
if err != nil {
ms := fmt.Sprintf("exec cmd: mount -o bind %s %s err:%v", sourcePath, ti.target, err)
log.Error(err, "bind mount error")
return fmt.Errorf(ms)
Expand Down

0 comments on commit 23f1662

Please sign in to comment.