Documentation
¶
Index ¶
- Constants
- Variables
- func CleanupPodData(podDir, remoteVolumeDir, tmpfsVolumeDir string, ...) error
- func FlagsForClient(prefix string, config *ClientConfig) *pflag.FlagSet
- func GenerateUnmountCmd(binPath string, mountPoint string) []string
- func IsLikelyNotMountPoint(file string) (bool, error)
- func LookupUnmountUtil(extraLookupPaths []string, fuse bool) (string, error)
- func NewConfig(name string) (interface{}, error)
- func Register(name string, f FactoryFunc, cf ConfigFactoryFunc)
- func RemoveAllOneFilesystem(path string) error
- func ResolveHostPathMountSource(path, podUID, volName string, remote bool, ...) (string, error)
- func ResolveStorageCommand(bin string, args []string, remotePath, localPath string) []string
- type Client
- type ClientConfig
- type ConfigFactoryFunc
- type DriverConfig
- type ExitHandleFunc
- type FactoryFunc
- type Interface
- type NopConfig
- type NopDriver
Constants ¶
const ( StorageArgEnvRemotePath = "ARHAT_STORAGE_REMOTE_PATH" StorageArgEnvMountpoint = "ARHAT_STORAGE_MOUNTPOINT" )
Variables ¶
var ( ErrMountpointInUse = errors.New("already in use") ErrMountpointInProcess = errors.New("already in process") )
Functions ¶
func CleanupPodData ¶
func FlagsForClient ¶
func FlagsForClient(prefix string, config *ClientConfig) *pflag.FlagSet
func GenerateUnmountCmd ¶
func IsLikelyNotMountPoint ¶
IsLikelyNotMountPoint determines if a directory is not a mountpoint. It is fast but not necessarily ALWAYS correct. If the path is in fact a bind mount from one part of a mount to another it will not be detected. It also can not distinguish between mountpoints and symbolic links. mkdir /tmp/a /tmp/b; mount --bind /tmp/a /tmp/b; IsLikelyNotMountPoint("/tmp/b") will return true. When in fact /tmp/b is a mount point. If this situation is of interest to you, don't use this function...
func LookupUnmountUtil ¶
func Register ¶
func Register(name string, f FactoryFunc, cf ConfigFactoryFunc)
func RemoveAllOneFilesystem ¶
RemoveAllOneFilesystem removes path and any children it contains. It removes everything it can but returns the first error it encounters. If the path does not exist, RemoveAll returns nil (no error). It makes sure it does not cross mount boundary, i.e. it does *not* remove files from another filesystems. Like 'rm -rf --one-file-system'. It is copied from RemoveAll() sources, with IsLikelyNotMountPoint
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
type ClientConfig ¶
type ClientConfig struct { DriverConfig `json:",inline" yaml:",inline"` StdoutFile string `json:"stdoutFile" yaml:"stdoutFile"` StderrFile string `json:"stderrFile" yaml:"stderrFile"` SuccessTimeWait time.Duration `json:"successTimeWait" yaml:"successTimeWait"` ExtraLookupPaths []string `json:"extraLookupPaths" yaml:"extraLookupPaths"` }
func (*ClientConfig) CreateClient ¶
func (c *ClientConfig) CreateClient(ctx context.Context) (*Client, error)
type ConfigFactoryFunc ¶
type ConfigFactoryFunc func() interface{}
type DriverConfig ¶ added in v0.1.5
type DriverConfig struct { Driver string `json:"driver" yaml:"driver"` Config interface{} `json:"config" yaml:"config"` }
func (*DriverConfig) UnmarshalJSON ¶ added in v0.1.5
func (c *DriverConfig) UnmarshalJSON(data []byte) error
func (*DriverConfig) UnmarshalYAML ¶ added in v0.1.5
func (c *DriverConfig) UnmarshalYAML(value *yaml.Node) error