Merge pull request #729 from andyzhangx/fix-archive-dir-error

fix: archive dir error
This commit is contained in:
Andy Zhang 2024-08-08 09:53:11 +08:00 committed by GitHub
commit 2524d92ae0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -25,6 +25,7 @@ import (
"regexp"
"strconv"
"strings"
"time"
"github.com/container-storage-interface/spec/lib/go/csi"
"golang.org/x/net/context"
@ -235,6 +236,8 @@ func (cs *ControllerServer) DeleteVolume(ctx context.Context, req *csi.DeleteVol
return nil, status.Errorf(codes.Internal, "failed to mount nfs server: %v", err.Error())
}
defer func() {
// make sure archiving is completed before unmounting
time.Sleep(time.Second * 2)
if err = cs.internalUnmount(ctx, nfsVol); err != nil {
klog.Warningf("failed to unmount nfs server: %v", err.Error())
}