Documentation ¶
Index ¶
- Constants
- Variables
- func CreateTestingNS(baseName string, c clientset.Interface, labels map[string]string) (*v1.Namespace, error)
- func DeleteNS(c clientset.Interface, namespace string, timeout time.Duration) error
- func Failf(format string, args ...interface{})
- func GetNameForResource(name string, cluster *api.MysqlCluster) string
- func GetPodLogs(c clientset.Interface, namespace, podName, containerName string) (string, error)
- func HelmInstallChart(release, ns string)
- func HelmPurgeRelease(release string)
- func LoadConfig() (*restclient.Config, error)
- func LogContainersInPodsWithLabels(c clientset.Interface, ns string, match map[string]string, ...)
- func LogPodsWithLabels(c clientset.Interface, ns string, match map[string]string, ...)
- func Logf(format string, args ...interface{})
- func NewCluster(name, ns string) *api.MysqlCluster
- func NewClusterSecret(name, ns, pw string) *core.Secret
- func OrcClusterName(cluster *api.MysqlCluster) string
- func RegisterCommonFlags()
- func RegisterParseFlags()
- func RemoveCleanupAction(p CleanupActionHandle)
- func RestclientConfig(kubeContext string) (*clientcmdapi.Config, error)
- func RunCleanupActions()
- type CleanupActionHandle
- type Framework
- func (f *Framework) AfterEach()
- func (f *Framework) BeforeEach()
- func (f *Framework) ClusterEventuallyCondition(cluster *api.MysqlCluster, condType api.ClusterConditionType, ...)
- func (f *Framework) CreateNamespace(labels map[string]string) (*core.Namespace, error)
- func (f *Framework) ExecSQLOnNode(cluster *api.MysqlCluster, i int, user, password, query string) *sql.Rows
- func (f *Framework) GetPodForNode(cluster *api.MysqlCluster, i int) *core.Pod
- func (f *Framework) GetPodHostname(cluster *api.MysqlCluster, p int) string
- func (f *Framework) NodeEventuallyCondition(cluster *api.MysqlCluster, nodeName string, condType api.NodeConditionType, ...)
- func (f *Framework) WaitForPodReady(podName string) error
- type TestContextType
Constants ¶
const ( PodStartTimeout = 5 * time.Minute // How often to Poll pods, nodes and claims. Poll = 2 * time.Second )
const (
DefaultNamespaceDeletionTimeout = 10 * time.Minute
)
const (
RecommendedConfigPathEnvVar = "MYSQLOPERATORCONFIGS"
)
Variables ¶
var OrchestratorPort = 3000
var (
POLLING = 2 * time.Second
)
Functions ¶
func CreateTestingNS ¶
func CreateTestingNS(baseName string, c clientset.Interface, labels map[string]string) (*v1.Namespace, error)
CreateTestingNS should be used by every test, note that we append a common prefix to the provided test name. Please see NewFramework instead of using this directly.
func DeleteNS ¶
deleteNS deletes the provided namespace, waits for it to be completely deleted, and then checks whether there are any pods remaining in a non-terminating state.
func GetNameForResource ¶ added in v0.2.0
func GetNameForResource(name string, cluster *api.MysqlCluster) string
GetNameForResource returns the name of the cluster resource, see the function definition for what name means.
func GetPodLogs ¶
func HelmInstallChart ¶
func HelmInstallChart(release, ns string)
func HelmPurgeRelease ¶
func HelmPurgeRelease(release string)
func LoadConfig ¶
func LoadConfig() (*restclient.Config, error)
func LogPodsWithLabels ¶
func NewCluster ¶
func NewCluster(name, ns string) *api.MysqlCluster
func NewClusterSecret ¶
func OrcClusterName ¶
func OrcClusterName(cluster *api.MysqlCluster) string
func RegisterParseFlags ¶
func RegisterParseFlags()
func RemoveCleanupAction ¶
func RemoveCleanupAction(p CleanupActionHandle)
RemoveCleanupAction removes a function that was installed by AddCleanupAction.
func RestclientConfig ¶
func RestclientConfig(kubeContext string) (*clientcmdapi.Config, error)
func RunCleanupActions ¶
func RunCleanupActions()
RunCleanupActions runs all functions installed by AddCleanupAction. It does not remove them (see RemoveCleanupAction) but it does run unlocked, so they may remove themselves.
Types ¶
type CleanupActionHandle ¶
type CleanupActionHandle *int
func AddCleanupAction ¶
func AddCleanupAction(fn func()) CleanupActionHandle
AddCleanupAction installs a function that will be called in the event of the whole test being terminated. This allows arbitrary pieces of the overall test to hook into SynchronizedAfterSuite().
type Framework ¶
type Framework struct { BaseName string Namespace *core.Namespace Client client.Client ClientSet clientset.Interface SkipNamespaceCreation bool OrcClient orc.Interface Timeout time.Duration // contains filtered or unexported fields }
func NewFramework ¶
func (*Framework) AfterEach ¶
func (f *Framework) AfterEach()
AfterEach deletes the namespace, after reading its events.
func (*Framework) BeforeEach ¶
func (f *Framework) BeforeEach()
BeforeEach gets a client and makes a namespace.
func (*Framework) ClusterEventuallyCondition ¶
func (f *Framework) ClusterEventuallyCondition(cluster *api.MysqlCluster, condType api.ClusterConditionType, status core.ConditionStatus, timeout time.Duration)
func (*Framework) CreateNamespace ¶
func (*Framework) ExecSQLOnNode ¶
func (*Framework) GetPodForNode ¶
func (*Framework) GetPodHostname ¶ added in v0.2.0
func (f *Framework) GetPodHostname(cluster *api.MysqlCluster, p int) string
GetPodHostname returns for an index the pod hostname of a cluster
func (*Framework) NodeEventuallyCondition ¶
func (f *Framework) NodeEventuallyCondition(cluster *api.MysqlCluster, nodeName string, condType api.NodeConditionType, status core.ConditionStatus, timeout time.Duration)
func (*Framework) WaitForPodReady ¶
WaitForPodReady waits for the pod to flip to ready in the namespace.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package ginkgowrapper wraps Ginkgo Fail and Skip functions to panic with structured data instead of a constant string.
|
Package ginkgowrapper wraps Ginkgo Fail and Skip functions to panic with structured data instead of a constant string. |