Documentation
¶
Index ¶
- func CurrentSpecHash() string
- func DumpNamespaceDiagnostics(ctx context.Context, config *rest.Config, cli client.Client, ns, dir string)
- func DumpNamespaceEvents(ctx context.Context, cli client.Client, namespace string, since time.Time) (string, error)
- func EnsureNamespace(ctx context.Context, k8sClient client.Client, name string)
- func GetProjectDir() (string, error)
- func InstallCRDs(ctx context.Context) error
- func InstallCertManager(ctx context.Context) error
- func NewPortForwardDialer(config *rest.Config) controllerutil.DialContextFunc
- func PreloadImages(ctx context.Context, images []string) *errgroup.Group
- func Run(cmd *exec.Cmd) ([]byte, error)
- func SetupCA(ctx context.Context, k8sClient client.Client, namespace string, suffix uint32)
- func UninstallCRDs(ctx context.Context) error
- type ClickHouseClient
- func (c *ClickHouseClient) CheckDefaultDatabasesReplicated(ctx context.Context) error
- func (c *ClickHouseClient) CheckRead(ctx context.Context, order int) error
- func (c *ClickHouseClient) CheckWrite(ctx context.Context, order int) error
- func (c *ClickHouseClient) Close()
- func (c *ClickHouseClient) CreateDatabase(ctx context.Context) error
- func (c *ClickHouseClient) Exec(ctx context.Context, query string, args ...any) error
- func (c *ClickHouseClient) Query(ctx context.Context, query string, args ...any) (driver.Rows, error)
- func (c *ClickHouseClient) QueryRow(ctx context.Context, query string, result any) error
- type DumpResult
- type KeeperClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CurrentSpecHash ¶ added in v0.0.4
func CurrentSpecHash() string
CurrentSpecHash returns a stable hash for the currently running Ginkgo spec.
func DumpNamespaceDiagnostics ¶ added in v0.0.4
func DumpNamespaceDiagnostics(ctx context.Context, config *rest.Config, cli client.Client, ns, dir string)
DumpNamespaceDiagnostics dumps resources, pod logs and events from namespace.
func DumpNamespaceEvents ¶ added in v0.0.4
func DumpNamespaceEvents(ctx context.Context, cli client.Client, namespace string, since time.Time) (string, error)
DumpNamespaceEvents fetches all events in the namespace that occurred since sinceTime.
func EnsureNamespace ¶ added in v0.0.4
EnsureNamespace ensures the test namespace is created and active.
func GetProjectDir ¶
GetProjectDir will return the directory where the project is by walking up from the current working directory until it finds a go.mod file.
func InstallCRDs ¶ added in v0.0.4
InstallCRDs installs the CRDs into the cluster using make install.
func InstallCertManager ¶
InstallCertManager installs the cert manager bundle.
func NewPortForwardDialer ¶ added in v0.0.4
func NewPortForwardDialer(config *rest.Config) controllerutil.DialContextFunc
NewPortForwardDialer returns a DialContextFunc that connects to pods inside a Kubernetes cluster by creating SPDY port-forward streams through the API server. Pod hostnames are expected in the format: {podName}.{serviceName}.{namespace}.svc.{domain}.
func PreloadImages ¶ added in v0.0.4
PreloadImages pulls each image from the registry and loads it into the kind cluster. All images are processed in parallel.
func UninstallCRDs ¶ added in v0.0.4
UninstallCRDs removes the CRDs from the cluster using make uninstall.
Types ¶
type ClickHouseClient ¶
type ClickHouseClient struct {
// contains filtered or unexported fields
}
ClickHouseClient is a ClickHouse client for testing ClickHouse clusters.
func NewClickHouseClient ¶
func NewClickHouseClient( ctx context.Context, dialer controllerutil.DialContextFunc, cr *v1.ClickHouseCluster, auth ...clickhouse.Auth, ) (*ClickHouseClient, error)
NewClickHouseClient creates a new ClickHouseClient connected to the specified ClickHouseCluster.
func (*ClickHouseClient) CheckDefaultDatabasesReplicated ¶
func (c *ClickHouseClient) CheckDefaultDatabasesReplicated(ctx context.Context) error
CheckDefaultDatabasesReplicated checks that the default database has Replicated engine on all cluster nodes.
func (*ClickHouseClient) CheckRead ¶
func (c *ClickHouseClient) CheckRead(ctx context.Context, order int) error
CheckRead reads and verifies test data from the ClickHouse cluster.
func (*ClickHouseClient) CheckWrite ¶
func (c *ClickHouseClient) CheckWrite(ctx context.Context, order int) error
CheckWrite writes test data to the ClickHouse cluster.
func (*ClickHouseClient) Close ¶
func (c *ClickHouseClient) Close()
Close closes the ClickHouseClient and releases all resources.
func (*ClickHouseClient) CreateDatabase ¶
func (c *ClickHouseClient) CreateDatabase(ctx context.Context) error
CreateDatabase creates the test database on the ClickHouse cluster.
func (*ClickHouseClient) Exec ¶ added in v0.0.3
Exec executes a query on one of the ClickHouse cluster nodes.
type DumpResult ¶ added in v0.0.4
DumpResult holds a short summary and the full dump content.
func DumpNamespacePodLogs ¶ added in v0.0.4
func DumpNamespacePodLogs(ctx context.Context, config *rest.Config, namespace string) (DumpResult, error)
DumpNamespacePodLogs collects logs for all pod containers in the given namespace. The short dump contains only the last logTailLines lines per container.
func DumpNamespaceResources ¶ added in v0.0.4
func DumpNamespaceResources(ctx context.Context, cli client.Client, namespace string) (DumpResult, error)
DumpNamespaceResources collects all resources in the namespace. The full dump contains the complete JSON representation of each resource, while the short dump contains only the resource type and object names.
func (*DumpResult) Empty ¶ added in v0.0.4
func (d *DumpResult) Empty() bool
Empty returns true if no data dumped.
type KeeperClient ¶
type KeeperClient struct {
// contains filtered or unexported fields
}
KeeperClient is a ZooKeeper client for testing Keeper clusters.
func NewKeeperClient ¶
func NewKeeperClient( ctx context.Context, dialer controllerutil.DialContextFunc, cr *v1.KeeperCluster, ) (*KeeperClient, error)
NewKeeperClient creates a new KeeperClient connected to the specified KeeperCluster.
func (*KeeperClient) CheckRead ¶
func (c *KeeperClient) CheckRead(order int) error
CheckRead reads and verifies test data from the Keeper cluster.
func (*KeeperClient) CheckWrite ¶
func (c *KeeperClient) CheckWrite(order int) error
CheckWrite writes test data to the Keeper cluster.
func (*KeeperClient) Close ¶
func (c *KeeperClient) Close()
Close closes the KeeperClient and releases all resources.