Code change:
The mount code () is reasonably well tested but brings in the entire Kubernetes source tree when CSI plugins have to depend on it. With a few exceptions, most of the mount code could be refactored to be a minimal set of utilities that can be layered and make it easier to develop CSI plugins. I noticed that quite a few CSI plugins take a dependency on k/k just to get that one package. Suggestions: and split into a minimal dependency library and move it out of k/k (perhaps into staging and have it published out) stop depending on k/k and start depending on that library dependency on so the library is easily usable. In general, there is a lot of boiler plate for CSI, and pkg/util/mount is a significant portion of reuse.
If there no one was working on this, I can help do it. :-)
/assign
is this something you are still looking at? It's come up in sig-storage, and is on the planning spreadsheet for 1.12. It's something I'd like to work on as well, so want to see where you are at with it. While it didn't get any traction, I will point out that when me and some coworkers wrote several CSI drivers to the 0.1 version of the spec, we saw this problem, and factored this code out into a project that eventually landed at It looks quite a bit different now, because we found the k/k code didn't handle bind-mounts of block devices correctly, which was something new to CSI and K8s at the time.
did some work recently in pkg/util/mount to detect bind mounts better. What I would like to see is this handled in at least 3 steps: Mounter interface to separate out purely mounting helper functions and Kubernetes utilities the refactored mount library into an external repo, maybe under kubernetes-sigs mount library from Kubernetes and vendor the external repo
Awesome. I plan to start working on this now, and i agree with the refactor approach. I do wonder where the resulting library should end up? Would kubernetes/utils be the right place?, rather than kubernetes/kubernetes-sigs? k/utils seems odd to me, though, as one goal is to not have to vendor a bunch of code you don't care about. but, k/utils has the intent of holding many different projects in it. So if you want one thing out of it, you have to vendor all of k/utils. I like seeing things in separate repos. =) Location doesn't hold up the refactoring, however, so I'll work on that!
Can it just be a standalone package, like kubernetes/utils/mount?
Issues go stale after 90d of inactivity. Mark the issue as fresh with . Stale issues rot after an additional 30d of inactivity and eventually close. If this issue is safe to close now please do so with . Send feedback to sig-testing, kubernetes/test-infra and/or . /lifecycle stale
/remove-lifecycle stale
Issues go stale after 90d of inactivity. Mark the issue as fresh with . Stale issues rot after an additional 30d of inactivity and eventually close. If this issue is safe to close now please do so with . Send feedback to sig-testing, kubernetes/test-infra and/or . /lifecycle stale
/remove-lifecycle stale
Issues go stale after 90d of inactivity. Mark the issue as fresh with . Stale issues rot after an additional 30d of inactivity and eventually close. If this issue is safe to close now please do so with . Send feedback to sig-testing, kubernetes/test-infra and/or . /lifecycle stale
/remove-lifecycle stale
/remove-kind bug /kind cleanup
Hi Now that is merged, I wanted to confirm that the next step here would be to move to be a package in .
Yup!
let me know if you need a hand with git surgery
The git-foo wasn't too bad. Just slow to filter on the whole k/k repo. =) I've opened the PR at , feel free to take a look. Once that is in, we'll need to be cognizant to not letting any fixes come into k/k/pkg/util/mount, otherwise they might get lost. Once the package goes into , I can open the PR on k/k to make use of it!
Issues go stale after 90d of inactivity. Mark the issue as fresh with . Stale issues rot after an additional 30d of inactivity and eventually close. If this issue is safe to close now please do so with . Send feedback to sig-testing, kubernetes/test-infra and/or . /lifecycle stale
/remove-lifecycle stale

Related discussion:
text: func (sr *ServiceRegistryStorage) List(*url.URL) (interface{}, error) { list, err := sr.registry.ListServices() <ins> if err != nil { return nil, err } </ins> list.Kind = "cluster#serviceList" return list, err } func (sr *ServiceRegistryStorage) Get(id string) (interface{}, error) { service, err := sr.registry.GetService(id) <ins> if err != nil { return nil, err } </ins> service.Kind = "cluster#service" return service, err }