Documentation ¶
Index ¶
- Variables
- func AddNode(n Node) error
- func CleanupRegistry()
- func Contains(nodes []Node, n Node) bool
- func GetNodesByName() map[string]Node
- func GetNodesByVoDriverNodeID() 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 StoragePool
- 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 CleanupRegistry ¶
func CleanupRegistry()
CleanupRegistry removes entry of all nodes from registry
func GetNodesByName ¶
GetNodesByName returns map of nodes where the node name is the key
func GetNodesByVoDriverNodeID ¶
GetNodesByVoDriverNodeID returns map of nodes where volume driver node id is the key
func UpdateNode ¶
UpdateNode updates a given node if it exists in the node collection
Types ¶
type ConnectionOpts ¶
type ConnectionOpts struct { Timeout time.Duration TimeBeforeRetry time.Duration IgnoreError bool Sudo bool }
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 // DeleteNode deletes the given node DeleteNode(node Node, timeout time.Duration) 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, options ConnectionOpts) (string, error) // SetASGClusterSize sets node count per zone for an asg cluster SetASGClusterSize(perZoneCount int64, timeout time.Duration) error // GetASGClusterSize gets node count for an asg cluster GetASGClusterSize() (int64, error) // SetClusterVersion sets desired version for cluster and its node pools SetClusterVersion(version string, timeout time.Duration) error // GetClusterVersion returns version of cluster and its node pools GetClusterVersion() (clusterVersion string, nodePoolsVersion []string, err error) // GetZones returns list of zones in which ASG cluster is running GetZones() ([]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 Empty bool ConnectionOpts }
FindOpts provide additional options for find operation
type Node ¶
type Node struct { api.StorageNode VolDriverNodeID string Name string Addresses []string UsableAddr string Type Type Zone string Region string IsStorageDriverInstalled bool IsMetadataNode bool StoragePools []StoragePool // contains filtered or unexported fields }
Node encapsulates a node in the cluster
func GetMetadataNodes ¶
func GetMetadataNodes() []Node
GetMetadataNodes gets all the nodes which serves as internal kvdb metadata node
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 StoragePool ¶
type StoragePool struct { *api.StoragePool // StoragePoolAtInit in the storage pool that's captured when the test initializes. This is useful for tests that // want to track changes in a pool since the test was started. For e.g tracking pool expansion changes StoragePoolAtInit *api.StoragePool // WorkloadSize is the size in bytes of the workload that will be launched by test on this storage pool WorkloadSize uint64 }
StoragePool is the storage pool structure on the node
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