exec_mount_unsupported.go 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. // +build !linux
  2. /*
  3. Copyright 2017 The Kubernetes Authors.
  4. Licensed under the Apache License, Version 2.0 (the "License");
  5. you may not use this file except in compliance with the License.
  6. You may obtain a copy of the License at
  7. http://www.apache.org/licenses/LICENSE-2.0
  8. Unless required by applicable law or agreed to in writing, software
  9. distributed under the License is distributed on an "AS IS" BASIS,
  10. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. See the License for the specific language governing permissions and
  12. limitations under the License.
  13. */
  14. package exec
  15. import (
  16. "errors"
  17. "os"
  18. "k8s.io/kubernetes/pkg/util/mount"
  19. )
  20. type execMounter struct{}
  21. // NewExecMounter returns a mounter that uses provided Exec interface to mount and
  22. // unmount a filesystem. For all other calls it uses a wrapped mounter.
  23. func NewExecMounter(exec mount.Exec, wrapped mount.Interface) mount.Interface {
  24. return &execMounter{}
  25. }
  26. func (mounter *execMounter) Mount(source string, target string, fstype string, options []string) error {
  27. return nil
  28. }
  29. func (mounter *execMounter) Unmount(target string) error {
  30. return nil
  31. }
  32. func (mounter *execMounter) List() ([]mount.MountPoint, error) {
  33. return []mount.MountPoint{}, nil
  34. }
  35. func (mounter *execMounter) IsMountPointMatch(mp mount.MountPoint, dir string) bool {
  36. return (mp.Path == dir)
  37. }
  38. func (mounter *execMounter) IsLikelyNotMountPoint(file string) (bool, error) {
  39. return true, nil
  40. }
  41. func (mounter *execMounter) GetDeviceNameFromMount(mountPath, pluginMountDir string) (string, error) {
  42. return "", nil
  43. }
  44. func (mounter *execMounter) DeviceOpened(pathname string) (bool, error) {
  45. return false, nil
  46. }
  47. func (mounter *execMounter) PathIsDevice(pathname string) (bool, error) {
  48. return true, nil
  49. }
  50. func (mounter *execMounter) MakeRShared(path string) error {
  51. return nil
  52. }
  53. func (mounter *execMounter) GetFileType(pathname string) (mount.FileType, error) {
  54. return mount.FileType("fake"), errors.New("not implemented")
  55. }
  56. func (mounter *execMounter) MakeDir(pathname string) error {
  57. return nil
  58. }
  59. func (mounter *execMounter) MakeFile(pathname string) error {
  60. return nil
  61. }
  62. func (mounter *execMounter) ExistsPath(pathname string) (bool, error) {
  63. return true, errors.New("not implemented")
  64. }
  65. func (mounter *execMounter) EvalHostSymlinks(pathname string) (string, error) {
  66. return "", errors.New("not implemented")
  67. }
  68. func (mounter *execMounter) GetMountRefs(pathname string) ([]string, error) {
  69. return nil, errors.New("not implemented")
  70. }
  71. func (mounter *execMounter) GetFSGroup(pathname string) (int64, error) {
  72. return -1, errors.New("not implemented")
  73. }
  74. func (mounter *execMounter) GetSELinuxSupport(pathname string) (bool, error) {
  75. return false, errors.New("not implemented")
  76. }
  77. func (mounter *execMounter) GetMode(pathname string) (os.FileMode, error) {
  78. return 0, errors.New("not implemented")
  79. }