Documentation
¶
Index ¶
- Constants
- Variables
- func GetTargetFilePath(ctx context.Context, resourcePath, arg string) string
- func SMBActiveOnHost(ctx context.Context) (bool, error)
- func SetChrootPathPrefix(prefix string)
- type NetLink
- type NetLinkClient
- func (n *NetLinkClient) AddrList(link netlink.Link, family int) ([]netlink.Addr, error)
- func (n *NetLinkClient) LinkByIndex(index int) (netlink.Link, error)
- func (n *NetLinkClient) LinkList() ([]netlink.Link, error)
- func (n *NetLinkClient) RouteListFiltered(family int, filter *netlink.Route, filterMask uint64) ([]netlink.Route, error)
- type OSUtils
- func (o *OSUtils) DeleteResourceAtPath(ctx context.Context, resource string) error
- func (o *OSUtils) EnsureDirExists(ctx context.Context, path string) error
- func (o *OSUtils) EnsureFileExists(ctx context.Context, path string) error
- func (o *OSUtils) EvalSymlinks(path string) (string, error)
- func (o *OSUtils) GetHostSystemInfo(ctx context.Context) (*models.HostSystem, error)
- func (o *OSUtils) GetIPAddresses(ctx context.Context) ([]string, error)
- func (o *OSUtils) IsLikelyDir(mountpoint string) (bool, error)
- func (o *OSUtils) NFSActiveOnHost(ctx context.Context) (bool, error)
- func (o *OSUtils) PathExists(path string) (bool, error)
- func (o *OSUtils) PathExistsWithTimeout(ctx context.Context, path string, timeout time.Duration) (bool, error)
- func (o *OSUtils) ServiceActiveOnHost(ctx context.Context, service string) (bool, error)
- func (o *OSUtils) WaitForResourceDeletionAtPath(ctx context.Context, resource string, maxDuration time.Duration) error
- type Utils
Constants ¶
const ( Centos = "centos" RHEL = "rhel" Ubuntu = "ubuntu" Debian = "debian" )
Variables ¶
var ChrootPathPrefix string
Functions ¶
func GetTargetFilePath ¶
GetTargetFilePath method returns the path of target file based on OS.
func SMBActiveOnHost ¶
SMBActiveOnHost will always return false on non-windows platform
func SetChrootPathPrefix ¶
func SetChrootPathPrefix(prefix string)
Types ¶
type NetLinkClient ¶
type NetLinkClient struct{}
func NewNetLinkClient ¶
func NewNetLinkClient() *NetLinkClient
func (*NetLinkClient) LinkByIndex ¶
func (n *NetLinkClient) LinkByIndex(index int) (netlink.Link, error)
func (*NetLinkClient) RouteListFiltered ¶
type OSUtils ¶
type OSUtils struct {
// contains filtered or unexported fields
}
func (*OSUtils) DeleteResourceAtPath ¶
DeleteResourceAtPath makes sure that given named file or (empty) directory is removed
func (*OSUtils) EnsureDirExists ¶
EnsureDirExists makes sure that given directory structure exists
func (*OSUtils) EnsureFileExists ¶
EnsureFileExists makes sure that file of given name exists
func (*OSUtils) GetHostSystemInfo ¶
GetHostSystemInfo returns information about the host system
func (*OSUtils) GetIPAddresses ¶
GetIPAddresses returns the sorted list of Global Unicast IP addresses available to Trident
func (*OSUtils) IsLikelyDir ¶
IsLikelyDir determines if mountpoint is a directory
func (*OSUtils) NFSActiveOnHost ¶
NFSActiveOnHost will return if the rpc-statd daemon is active on the given host
func (*OSUtils) PathExists ¶
PathExists returns if path exists. This should only be used if the call will not block if the path or volume is inaccessible.
func (*OSUtils) PathExistsWithTimeout ¶
func (o *OSUtils) PathExistsWithTimeout(ctx context.Context, path string, timeout time.Duration) (bool, error)
PathExistsWithTimeout returns if path exists, and can return a timeout error on linux; windows ignores the timeout. Context timeouts may be ignored and are handled by the underlying implementation. This should be used instead of PathExists if there is a chance the call will block if the path or volume is inaccessible, such as on an NFS mount.
func (*OSUtils) ServiceActiveOnHost ¶
ServiceActiveOnHost checks if the service is currently running
type Utils ¶
type Utils interface {
NFSActiveOnHost(ctx context.Context) (bool, error)
ServiceActiveOnHost(ctx context.Context, service string) (bool, error)
GetHostSystemInfo(ctx context.Context) (*models.HostSystem, error)
GetIPAddresses(ctx context.Context) ([]string, error)
PathExists(path string) (bool, error)
PathExistsWithTimeout(ctx context.Context, path string, timeout time.Duration) (bool, error)
IsLikelyDir(mountpoint string) (bool, error)
DeleteResourceAtPath(ctx context.Context, resource string) error
WaitForResourceDeletionAtPath(ctx context.Context, resource string, maxDuration time.Duration) error
EnsureFileExists(ctx context.Context, path string) error
EnsureDirExists(ctx context.Context, path string) error
EvalSymlinks(path string) (string, error)
}