kubernetes / mount-utils

Package mount defines an interface to mounting filesystems.
Apache License 2.0
57 stars 30 forks source link

Using the mount_linux implementation of MounterForceUnmounter #8

Closed ygalblum closed 2 years ago

ygalblum commented 2 years ago

Hello,

I'm implementing a CSI based on NFS and I am using the mount-utils package. Since un-mounts may occur when the NFS server is down, I would like to use the CleanupMountPointWithForce method. For that I need an instance of a MounterForceUnmounter, instead of that of an Interface.

Looking at the code, I've found that the mount interface is split into two. The base interface called Interface and the MounterForceUnmounter interface that inherits from the base and adds the UnmountWithForce method. The Linux implementation (in mount_linux) actually implements MounterForceUnmounter interface (by implementing UnmountWithForce), in the Mounter struct but it's New method returns the base interface Interface. mount_linux also defines a variable called MounterForceUnmounter as a pointer to a static Mounter instance, but does not instantiate its fields like New does.

I am kinda new to Golang, so maybe I am missing something, but shouldn't there be a way to get a MounterForceUnmounter interface implementation? Since the New method calls an internal detectSystemd method, I would rather not create the instance manually

Any help will be much appreciated

k8s-triage-robot commented 2 years ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot commented 2 years ago

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot commented 2 years ago

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

k8s-ci-robot commented 2 years ago

@k8s-triage-robot: Closing this issue.

In response to [this](https://github.com/kubernetes/mount-utils/issues/8#issuecomment-1106476578): >The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. > >This bot triages issues and PRs according to the following rules: >- After 90d of inactivity, `lifecycle/stale` is applied >- After 30d of inactivity since `lifecycle/stale` was applied, `lifecycle/rotten` is applied >- After 30d of inactivity since `lifecycle/rotten` was applied, the issue is closed > >You can: >- Reopen this issue or PR with `/reopen` >- Mark this issue or PR as fresh with `/remove-lifecycle rotten` >- Offer to help out with [Issue Triage][1] > >Please send feedback to sig-contributor-experience at [kubernetes/community](https://github.com/kubernetes/community). > >/close > >[1]: https://www.kubernetes.dev/docs/guide/issue-triage/ Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.