mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 02:33:34 +00:00
rebase: update k8s.io/mount-utils to current master
kubernetes/kubernetes#111083 has been merged and synced into k8s.io/mount-utils. This should remove any systemd log messages while calling NodeStageVolume and NodeGetVolumeStats. Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
committed by
mergify[bot]
parent
3c3cbc8005
commit
533994daff
22
vendor/k8s.io/mount-utils/fake_mounter.go
generated
vendored
22
vendor/k8s.io/mount-utils/fake_mounter.go
generated
vendored
@ -32,8 +32,9 @@ type FakeMounter struct {
|
||||
MountCheckErrors map[string]error
|
||||
// Some tests run things in parallel, make sure the mounter does not produce
|
||||
// any golang's DATA RACE warnings.
|
||||
mutex sync.Mutex
|
||||
UnmountFunc UnmountFunc
|
||||
mutex sync.Mutex
|
||||
UnmountFunc UnmountFunc
|
||||
skipMountPointCheck bool
|
||||
}
|
||||
|
||||
// UnmountFunc is a function callback to be executed during the Unmount() call.
|
||||
@ -64,6 +65,11 @@ func NewFakeMounter(mps []MountPoint) *FakeMounter {
|
||||
}
|
||||
}
|
||||
|
||||
func (f *FakeMounter) WithSkipMountPointCheck() *FakeMounter {
|
||||
f.skipMountPointCheck = true
|
||||
return f
|
||||
}
|
||||
|
||||
// ResetLog clears all the log entries in FakeMounter
|
||||
func (f *FakeMounter) ResetLog() {
|
||||
f.mutex.Lock()
|
||||
@ -212,6 +218,18 @@ func (f *FakeMounter) IsLikelyNotMountPoint(file string) (bool, error) {
|
||||
return true, nil
|
||||
}
|
||||
|
||||
func (f *FakeMounter) canSafelySkipMountPointCheck() bool {
|
||||
return f.skipMountPointCheck
|
||||
}
|
||||
|
||||
func (f *FakeMounter) IsMountPoint(file string) (bool, error) {
|
||||
notMnt, err := f.IsLikelyNotMountPoint(file)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
return !notMnt, nil
|
||||
}
|
||||
|
||||
// GetMountRefs finds all mount references to the path, returns a
|
||||
// list of paths.
|
||||
func (f *FakeMounter) GetMountRefs(pathname string) ([]string, error) {
|
||||
|
Reference in New Issue
Block a user