|
| 1 | +//go:build !linux |
| 2 | +// +build !linux |
| 3 | + |
| 4 | +/* |
| 5 | +Copyright 2017 The Kubernetes Authors. |
| 6 | +
|
| 7 | +Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 | +you may not use this file except in compliance with the License. |
| 9 | +You may obtain a copy of the License at |
| 10 | +
|
| 11 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | +
|
| 13 | +Unless required by applicable law or agreed to in writing, software |
| 14 | +distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | +See the License for the specific language governing permissions and |
| 17 | +limitations under the License. |
| 18 | +*/ |
| 19 | + |
| 20 | +package hostmount |
| 21 | + |
| 22 | +import ( |
| 23 | + "fmt" |
| 24 | + "k8s.io/mount-utils" |
| 25 | + "k8s.io/utils/nsenter" |
| 26 | +) |
| 27 | + |
| 28 | +func New(ne *nsenter.Nsenter) *Mounter { |
| 29 | + return &Mounter{ne: ne} |
| 30 | +} |
| 31 | + |
| 32 | +type Mounter struct { |
| 33 | + ne *nsenter.Nsenter |
| 34 | + mount.Interface |
| 35 | +} |
| 36 | + |
| 37 | +var _ mount.Interface = &Mounter{} |
| 38 | + |
| 39 | +func (*Mounter) List() ([]mount.MountPoint, error) { |
| 40 | + return nil, fmt.Errorf("List not implemented for containerized mounter") |
| 41 | +} |
| 42 | + |
| 43 | +func (n *Mounter) Mount(source string, target string, fstype string, options []string) error { |
| 44 | + return fmt.Errorf("Mount not implemented for containerized mounter") |
| 45 | +} |
| 46 | + |
| 47 | +func (n *Mounter) MountSensitive(source string, target string, fstype string, options []string, sensitiveOptions []string) error { |
| 48 | + return fmt.Errorf("MountSensitive not implemented for containerized mounter") |
| 49 | +} |
| 50 | + |
| 51 | +func (n *Mounter) GetMountRefs(pathname string) ([]string, error) { |
| 52 | + return nil, fmt.Errorf("GetMountRefs not implemented for containerized mounter") |
| 53 | +} |
| 54 | + |
| 55 | +func (mounter *Mounter) IsLikelyNotMountPoint(file string) (bool, error) { |
| 56 | + return false, fmt.Errorf("IsLikelyNotMountPoint not implemented for containerized mounter") |
| 57 | +} |
| 58 | + |
| 59 | +func (n *Mounter) Unmount(target string) error { |
| 60 | + return fmt.Errorf("Unmount not implemented for containerized mounter") |
| 61 | +} |
| 62 | + |
| 63 | +func (n *Mounter) MountSensitiveWithoutSystemd(source string, target string, fstype string, options []string, sensitiveOptions []string) error { |
| 64 | + return fmt.Errorf("MountSensitiveWithoutSystemd not implemented for containerized mounter") |
| 65 | +} |
| 66 | + |
| 67 | +func (n *Mounter) MountSensitiveWithoutSystemdWithMountFlags(source string, target string, fstype string, options []string, sensitiveOptions []string, mountFlags []string) error { |
| 68 | + return fmt.Errorf("MountSensitiveWithoutSystemdWithMountFlags not implemented for containerized mounter") |
| 69 | +} |
0 commit comments