...
1
2
3
4
19
20 package hostutil
21
22 import (
23 "errors"
24 "os"
25
26 "k8s.io/mount-utils"
27 )
28
29
30
31 type HostUtil struct{}
32
33
34
35 func NewHostUtil() *HostUtil {
36 return &HostUtil{}
37 }
38
39 var errUnsupported = errors.New("volume/util/hostutil on this platform is not supported")
40
41
42 func (hu *HostUtil) DeviceOpened(pathname string) (bool, error) {
43 return false, errUnsupported
44 }
45
46
47 func (hu *HostUtil) PathIsDevice(pathname string) (bool, error) {
48 return true, errUnsupported
49 }
50
51
52 func (hu *HostUtil) GetDeviceNameFromMount(mounter mount.Interface, mountPath, pluginMountDir string) (string, error) {
53 return getDeviceNameFromMount(mounter, mountPath, pluginMountDir)
54 }
55
56
57 func (hu *HostUtil) MakeRShared(path string) error {
58 return errUnsupported
59 }
60
61
62 func (hu *HostUtil) GetFileType(pathname string) (FileType, error) {
63 return FileType("fake"), errUnsupported
64 }
65
66
67 func (hu *HostUtil) MakeFile(pathname string) error {
68 return errUnsupported
69 }
70
71
72 func (hu *HostUtil) MakeDir(pathname string) error {
73 return errUnsupported
74 }
75
76
77 func (hu *HostUtil) PathExists(pathname string) (bool, error) {
78 return true, errUnsupported
79 }
80
81
82 func (hu *HostUtil) EvalHostSymlinks(pathname string) (string, error) {
83 return "", errUnsupported
84 }
85
86
87 func (hu *HostUtil) GetOwner(pathname string) (int64, int64, error) {
88 return -1, -1, errUnsupported
89 }
90
91
92 func (hu *HostUtil) GetSELinuxSupport(pathname string) (bool, error) {
93 return false, errUnsupported
94 }
95
96
97 func (hu *HostUtil) GetMode(pathname string) (os.FileMode, error) {
98 return 0, errUnsupported
99 }
100
101 func getDeviceNameFromMount(mounter mount.Interface, mountPath, pluginMountDir string) (string, error) {
102 return "", errUnsupported
103 }
104
105
106
107 func (hu *HostUtil) GetSELinuxMountContext(pathname string) (string, error) {
108 return "", errUnsupported
109 }
110
View as plain text