File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -112,13 +112,18 @@ func (filesystemAPI) IsSymlink(tgt string) (bool, error) {
112112	// This code is similar to k8s.io/kubernetes/pkg/util/mount except the pathExists usage. 
113113	// Also in a remote call environment the os error cannot be passed directly back, hence the callers 
114114	// are expected to perform the isExists check before calling this call in CSI proxy. 
115- 	stat , err  :=  os . Lstat (tgt )
115+ 	isSymlink , err  :=  utils . IsPathSymlink (tgt )
116116	if  err  !=  nil  {
117117		return  false , err 
118118	}
119119
120- 	// If its a link and it points to an existing file then its a mount point. 
121- 	if  stat .Mode ()& os .ModeSymlink  !=  0  {
120+ 	// mounted folder created by SetVolumeMountPoint may still report ModeSymlink == 0 
121+ 	mountedFolder , err  :=  utils .IsMountedFolder (tgt )
122+ 	if  err  !=  nil  {
123+ 		return  false , err 
124+ 	}
125+ 
126+ 	if  isSymlink  ||  mountedFolder  {
122127		target , err  :=  os .Readlink (tgt )
123128		if  err  !=  nil  {
124129			return  false , fmt .Errorf ("readlink error: %v" , err )
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments