Documentation
¶
Index ¶
- Variables
- func AddNode(n Node) error
- func Contains(nodes []Node, n Node) bool
- func GetNodesByName() map[string]Node
- func Register(name string, d Driver) error
- func UpdateNode(n Node) error
- type ConnectionOpts
- type Driver
- type ErrFailedToFindFileOnNode
- type ErrFailedToRebootNode
- type ErrFailedToRecoverDrive
- type ErrFailedToRunCommand
- type ErrFailedToRunSystemctlOnNode
- type ErrFailedToShutdownNode
- type ErrFailedToSystemCheck
- type ErrFailedToTestConnection
- type ErrFailedToYankDrive
- type FindOpts
- type FindType
- type Node
- type RebootNodeOpts
- type ShutdownNodeOpts
- type SystemctlOpts
- type TestConnectionOpts
- type Type
Constants ¶
This section is empty.
Variables ¶
var NotSupportedDriver = ¬SupportedDriver{}
NotSupportedDriver provides the default driver with none of the operations supported
Functions ¶
func GetNodesByName ¶
GetNodesByName returns map of nodes where the node name is the key
func UpdateNode ¶
UpdateNode updates a given node if it exists in the node collection
Types ¶
type ConnectionOpts ¶
ConnectionOpts provide basic options for all operations and can be embedded by other options
type Driver ¶
type Driver interface {
// Init initializes the node driver under the given scheduler
Init() error
// String returns the string name of this driver.
String() string
// RebootNode reboots the given node
RebootNode(node Node, options RebootNodeOpts) error
// RunCommand runs the given command on the node and returns the output
RunCommand(node Node, command string, options ConnectionOpts) (string, error)
// ShutdownNode shuts down the given node
ShutdownNode(node Node, options ShutdownNodeOpts) error
// FindFiles finds and returns the files for the given path regex and the node
FindFiles(path string, node Node, options FindOpts) (string, error)
// Systemctl runs a systemctl command for the given service on the node
Systemctl(node Node, service string, options SystemctlOpts) error
// TestConnection tests connection to given node. returns nil if driver can connect to given node
TestConnection(node Node, options ConnectionOpts) error
// YankDrive simulates a failure on the provided drive on the given node.
// It returns the bus ID of the drive which can be used to recover it back
YankDrive(node Node, driveNameToFail string, options ConnectionOpts) (string, error)
// RecoverDrive recovers the given drive from failure on the given node.
RecoverDrive(node Node, driveNameToRecover string, driveUUID string, options ConnectionOpts) error
// SystemCheck checks whether core files are present on the given node.
SystemCheck(node Node) (string, error)
}
Driver provides the node driver interface
type ErrFailedToFindFileOnNode ¶
ErrFailedToFindFileOnNode error type when failing to run find on the node
func (*ErrFailedToFindFileOnNode) Error ¶
func (e *ErrFailedToFindFileOnNode) Error() string
type ErrFailedToRebootNode ¶
ErrFailedToRebootNode error type when failing to reboot a node
func (*ErrFailedToRebootNode) Error ¶
func (e *ErrFailedToRebootNode) Error() string
type ErrFailedToRecoverDrive ¶
ErrFailedToRecoverDrive error type when we fail to simulate drive failure
func (*ErrFailedToRecoverDrive) Error ¶
func (e *ErrFailedToRecoverDrive) Error() string
type ErrFailedToRunCommand ¶
ErrFailedToRunCommand error type when failing to run command
func (*ErrFailedToRunCommand) Error ¶
func (e *ErrFailedToRunCommand) Error() string
type ErrFailedToRunSystemctlOnNode ¶
ErrFailedToRunSystemctlOnNode error type when failing to run systemctl on the node
func (*ErrFailedToRunSystemctlOnNode) Error ¶
func (e *ErrFailedToRunSystemctlOnNode) Error() string
type ErrFailedToShutdownNode ¶
ErrFailedToShutdownNode error type when failing to shutdown the node
func (*ErrFailedToShutdownNode) Error ¶
func (e *ErrFailedToShutdownNode) Error() string
type ErrFailedToSystemCheck ¶
ErrFailedToSystemCheck error type when we fail to check for core files
func (*ErrFailedToSystemCheck) Error ¶
func (e *ErrFailedToSystemCheck) Error() string
type ErrFailedToTestConnection ¶
ErrFailedToTestConnection error type when failing to test connection
func (*ErrFailedToTestConnection) Error ¶
func (e *ErrFailedToTestConnection) Error() string
type ErrFailedToYankDrive ¶
ErrFailedToYankDrive error type when we fail to simulate drive failure
func (*ErrFailedToYankDrive) Error ¶
func (e *ErrFailedToYankDrive) Error() string
type FindOpts ¶
type FindOpts struct {
Name string
MinDepth int
MaxDepth int
Type FindType
ConnectionOpts
}
FindOpts provide additional options for find operation
type Node ¶
type Node struct {
VolDriverNodeID string
Name string
Addresses []string
UsableAddr string
Type Type
IsStorageDriverInstalled bool
// contains filtered or unexported fields
}
Node encapsulates a node in the cluster
func GetStorageDriverNodes ¶
func GetStorageDriverNodes() []Node
GetStorageDriverNodes returns only the worker node where storage driver is installed
func GetWorkerNodes ¶
func GetWorkerNodes() []Node
GetWorkerNodes returns only the worker nodes/agent nodes
type RebootNodeOpts ¶
type RebootNodeOpts struct {
Force bool
ConnectionOpts
}
RebootNodeOpts provide additional options for reboot operation
type ShutdownNodeOpts ¶
type ShutdownNodeOpts struct {
Force bool
ConnectionOpts
}
ShutdownNodeOpts provide additional options for shutdown operation
type SystemctlOpts ¶
type SystemctlOpts struct {
Action string
ConnectionOpts
}
SystemctlOpts provide options for systemctl operation
type TestConnectionOpts ¶
type TestConnectionOpts struct {
ConnectionOpts
}
TestConnectionOpts provide additional options for test connection operation