Documentation ¶
Index ¶
- Constants
- Variables
- func BackupCompleted() gomegatypes.GomegaMatcher
- func CreateTestingNS(baseName string, c clientset.Interface, labels map[string]string) (*corev1.Namespace, error)
- func DeleteNS(c clientset.Interface, namespace string, timeout time.Duration) error
- func Failf(format string, args ...interface{})
- func GetBucketName() string
- func GetClusterLabels(cluster *api.MysqlCluster) labels.Set
- func GetNameForJob(backup *api.MysqlBackup) string
- func GetNameForResource(name string, cluster *api.MysqlCluster) string
- func GetPodLogs(c clientset.Interface, namespace, podName, containerName string) (string, error)
- func HaveBackupCond(condType api.BackupConditionType, status corev1.ConditionStatus) gomegatypes.GomegaMatcher
- func HaveClusterCond(condType api.ClusterConditionType, status corev1.ConditionStatus) gomegatypes.GomegaMatcher
- func HaveClusterReplicas(replicas int) gomegatypes.GomegaMatcher
- func HelmInstallChart(release, ns string)
- func HelmPurgeRelease(release, ns 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 NewBackup(cluster *api.MysqlCluster, bucket string) *api.MysqlBackup
- func NewCluster(name, ns string) *api.MysqlCluster
- func NewClusterSecret(name, ns, pw string) *corev1.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) GetClusterPVCsFn(cluster *api.MysqlCluster) func() []corev1.PersistentVolumeClaim
- func (f *Framework) GetPodForNode(cluster *api.MysqlCluster, i int) *corev1.Pod
- func (f *Framework) GetPodHostname(cluster *api.MysqlCluster, p int) string
- func (f *Framework) NewGCSBackupSecret() *corev1.Secret
- func (f *Framework) NodeEventuallyCondition(cluster *api.MysqlCluster, nodeName string, condType api.NodeConditionType, ...)
- func (f *Framework) ReadSQLTest(cluster *api.MysqlCluster, pod int, pw string) string
- func (f *Framework) RefreshBackupFn(backup *api.MysqlBackup) func() *api.MysqlBackup
- func (f *Framework) RefreshClusterFn(cluster *api.MysqlCluster) func() *api.MysqlCluster
- func (f *Framework) WaitForPodReady(podName string) error
- func (f *Framework) WriteSQLTest(cluster *api.MysqlCluster, pod int, pw string) string
- 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 BackupCompleted ¶
func BackupCompleted() gomegatypes.GomegaMatcher
BackupCompleted a matcher to check cluster completion
func CreateTestingNS ¶
func CreateTestingNS(baseName string, c clientset.Interface, labels map[string]string) (*corev1.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 GetBucketName ¶
func GetBucketName() string
func GetClusterLabels ¶
func GetClusterLabels(cluster *api.MysqlCluster) labels.Set
GetClusterLabels returns labels.Set for the given cluster
func GetNameForJob ¶
func GetNameForJob(backup *api.MysqlBackup) string
GetNameForJob returns the job name of a backup
func GetNameForResource ¶
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 HaveBackupCond ¶
func HaveBackupCond(condType api.BackupConditionType, status corev1.ConditionStatus) gomegatypes.GomegaMatcher
HaveBackupCond is a helper func that returns a matcher to check for an existing condition in a ClusterCondition list.
func HaveClusterCond ¶
func HaveClusterCond(condType api.ClusterConditionType, status corev1.ConditionStatus) gomegatypes.GomegaMatcher
HaveClusterCond is a helper func that returns a matcher to check for an existing condition in a ClusterCondition list.
func HaveClusterReplicas ¶
func HaveClusterReplicas(replicas int) gomegatypes.GomegaMatcher
HaveClusterRepliacs matcher for replicas
func HelmInstallChart ¶
func HelmInstallChart(release, ns string)
func HelmPurgeRelease ¶
func HelmPurgeRelease(release, ns string)
func LoadConfig ¶
func LoadConfig() (*restclient.Config, error)
func LogPodsWithLabels ¶
func NewBackup ¶
func NewBackup(cluster *api.MysqlCluster, bucket string) *api.MysqlBackup
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 Log logr.Logger // 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 corev1.ConditionStatus, timeout time.Duration)
func (*Framework) CreateNamespace ¶
func (*Framework) ExecSQLOnNode ¶
func (*Framework) GetClusterPVCsFn ¶
func (f *Framework) GetClusterPVCsFn(cluster *api.MysqlCluster) func() []corev1.PersistentVolumeClaim
func (*Framework) GetPodForNode ¶
func (*Framework) GetPodHostname ¶
func (f *Framework) GetPodHostname(cluster *api.MysqlCluster, p int) string
GetPodHostname returns for an index the pod hostname of a cluster
func (*Framework) NewGCSBackupSecret ¶
func (*Framework) NodeEventuallyCondition ¶
func (f *Framework) NodeEventuallyCondition(cluster *api.MysqlCluster, nodeName string, condType api.NodeConditionType, status corev1.ConditionStatus, timeout time.Duration)
func (*Framework) ReadSQLTest ¶
func (*Framework) RefreshBackupFn ¶
func (f *Framework) RefreshBackupFn(backup *api.MysqlBackup) func() *api.MysqlBackup
func (*Framework) RefreshClusterFn ¶
func (f *Framework) RefreshClusterFn(cluster *api.MysqlCluster) func() *api.MysqlCluster
func (*Framework) WaitForPodReady ¶
WaitForPodReady waits for the pod to flip to ready in the namespace.
func (*Framework) WriteSQLTest ¶
type TestContextType ¶
type TestContextType struct { KubeHost string KubeConfig string KubeContext string ReportDir string ChartPath string ChartValues string OperatorImage string SidecarMysql57Image string SidecarMysql8Image string OrchestratorImage string TimeoutSeconds int DumpLogsOnFailure bool }
var TestContext TestContextType
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. |