Code Monkey home page Code Monkey logo

Comments (6)

valer-cara avatar valer-cara commented on July 23, 2024

Had the same issue. From what I gather, the hostpathVolumes association is lost since it's stored in memory only.

I've done a ultra-dirty proof of concept to try and rebuild that mapping when the provisioner starts and I got my pods unstuck.

Ofc, this needs a proper implementation - i guess to fully reconstruct, it either needs to query the k8s api for PVs or it should persist this struct somewhere (though i guess that's problematic too in terms of resilience).

diff --git a/pkg/hostpath/hostpath.go b/pkg/hostpath/hostpath.go                                                       
index 725e0012..eea4eb0b 100644                            
--- a/pkg/hostpath/hostpath.go                             
+++ b/pkg/hostpath/hostpath.go                             
@@ -19,6 +19,7 @@ package hostpath                         
 import (                                                  
        "fmt"                                              
        "io"                                               
+       "io/ioutil"                                        
        "os"                                               
                                                           
        "github.com/golang/glog"                           
@@ -106,6 +107,8 @@ func NewHostPathDriver(driverName, nodeID, endpoint, version string, ephemeral b                   
 }                                                         
                                                           
 func (hp *hostPath) Run() {                               
+       refreshHostpathVolumes()                           
+                                                          
        // Create GRPC servers                             
        hp.ids = NewIdentityServer(hp.name, hp.version)    
        hp.ns = NewNodeServer(hp.nodeID, hp.ephemeral)     
@@ -179,6 +182,27 @@ func deleteHostpathVolume(volID string) error {                                                   
        return nil                                         
 }                                                         
                                                           
+func refreshHostpathVolumes() error {                     
+       files, err := ioutil.ReadDir(provisionRoot)        
+       if err != nil {                                    
+               glog.Fatalf("Cannot refresh existing volumes while initializing.. %v", err)                            
+       }                                                  
+                                                          
+       for _, f := range files {                          
+               if len(f.Name()) > 5 && f.IsDir() {        
+                       volID := f.Name()                  
+                       hostPathVolumes[volID] = hostPathVolume{                                                       
+                               VolID:         volID,      
+                               VolName:       volID,      
+                               VolSize:       9999999,    
+                               VolPath:       getVolumePath(volID),                                                   
+                               VolAccessType: mountAccess,
+                       }                                  
+               }                                          
+       }                                                  
+       return nil                                         
+}                                                         
+                                                          
 // hostPathIsEmpty is a simple check to determine if the specified hostpath directory                                 
 // is empty or not.                                       

from csi-driver-host-path.

fejta-bot avatar fejta-bot commented on July 23, 2024

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

from csi-driver-host-path.

fejta-bot avatar fejta-bot commented on July 23, 2024

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

from csi-driver-host-path.

fejta-bot avatar fejta-bot commented on July 23, 2024

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

from csi-driver-host-path.

k8s-ci-robot avatar k8s-ci-robot commented on July 23, 2024

@fejta-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

from csi-driver-host-path.

k8s-ci-robot avatar k8s-ci-robot commented on July 23, 2024

@shantanugadgil: You can't reopen an issue/PR unless you authored it or you are a collaborator.

In response to this:

/reopen

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

from csi-driver-host-path.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.