Documentation
¶
Overview ¶
Package mock provides a mock cluster driver implementation for testing. This package is intended for use in tests only and should not be imported by production code.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClearErrorConfig ¶
func ClearErrorConfig(profileName string)
ClearErrorConfig clears any configured errors for a profile.
func ProfileExists ¶
ProfileExists returns true if a cluster profile exists in the global state.
func ResetGlobalState ¶
func ResetGlobalState()
ResetGlobalState resets all cluster state. Should be called in test setup/teardown.
func SetClusterState ¶
SetClusterState allows tests to set up specific cluster states.
func SetErrorConfig ¶
func SetErrorConfig(profileName string, errCfg ErrorConfig)
SetErrorConfig configures the mock driver to return specific errors for a profile.
Types ¶
type ClusterState ¶
type ClusterState struct {
State cluster.State
KubernetesVersion string
IPAddress string
StartCallCount int
StopCallCount int
DestroyCallCount int
StatusCallCount int
}
ClusterState is a read-only view of cluster state for testing assertions.
func GetState ¶
func GetState(profileName string) *ClusterState
GetState returns the current state of a cluster profile for testing assertions.
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
Driver is a mock implementation of cluster.Manager for testing.