1// +build !linux,!windows
2
3/*
4Copyright 2014 The Kubernetes Authors.
5
6Licensed under the Apache License, Version 2.0 (the "License");
7you may not use this file except in compliance with the License.
8You may obtain a copy of the License at
9
10    http://www.apache.org/licenses/LICENSE-2.0
11
12Unless required by applicable law or agreed to in writing, software
13distributed under the License is distributed on an "AS IS" BASIS,
14WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15See the License for the specific language governing permissions and
16limitations under the License.
17*/
18
19package mount
20
21import (
22	"errors"
23)
24
25// Mounter implements mount.Interface for unsupported platforms
26type Mounter struct {
27	mounterPath string
28}
29
30var errUnsupported = errors.New("util/mount on this platform is not supported")
31
32// New returns a mount.Interface for the current system.
33// It provides options to override the default mounter behavior.
34// mounterPath allows using an alternative to `/bin/mount` for mounting.
35func New(mounterPath string) Interface {
36	return &Mounter{
37		mounterPath: mounterPath,
38	}
39}
40
41// Mount always returns an error on unsupported platforms
42func (mounter *Mounter) Mount(source string, target string, fstype string, options []string) error {
43	return errUnsupported
44}
45
46// Mount always returns an error on unsupported platforms
47func (mounter *Mounter) MountSensitive(source string, target string, fstype string, options []string, sensitiveOptions []string) error {
48	return errUnsupported
49}
50
51// Unmount always returns an error on unsupported platforms
52func (mounter *Mounter) Unmount(target string) error {
53	return errUnsupported
54}
55
56// List always returns an error on unsupported platforms
57func (mounter *Mounter) List() ([]MountPoint, error) {
58	return []MountPoint{}, errUnsupported
59}
60
61// IsLikelyNotMountPoint always returns an error on unsupported platforms
62func (mounter *Mounter) IsLikelyNotMountPoint(file string) (bool, error) {
63	return true, errUnsupported
64}
65
66// GetMountRefs always returns an error on unsupported platforms
67func (mounter *Mounter) GetMountRefs(pathname string) ([]string, error) {
68	return nil, errUnsupported
69}
70
71func (mounter *SafeFormatAndMount) formatAndMountSensitive(source string, target string, fstype string, options []string, sensitiveOptions []string) error {
72	return mounter.Interface.Mount(source, target, fstype, options)
73}
74
75func (mounter *SafeFormatAndMount) diskLooksUnformatted(disk string) (bool, error) {
76	return true, errUnsupported
77}
78