helpers

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 1, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TestHelper

type TestHelper struct {
	*base.TestHelper
}

TestHelper is a collection of helpers for testing operators. It extends the generic TestHelper from modules/test.

func NewTestHelper

func NewTestHelper(
	ctx context.Context,
	k8sClient client.Client,
	timeout time.Duration,
	interval time.Duration,
	logger logr.Logger,
) *TestHelper

NewTestHelper returns a TestHelper

func (*TestHelper) AssertTransportURLDoesNotExist

func (tc *TestHelper) AssertTransportURLDoesNotExist(name types.NamespacedName)

AssertTransportURLDoesNotExist ensures the TransportURL resource does not exist in a k8s cluster.

func (*TestHelper) CreateMemcached

func (tc *TestHelper) CreateMemcached(namespace string, memcachedName string, spec memcachedv1.MemcachedSpec) types.NamespacedName

CreateMemcached creates a new Memcached instance with the specified namespace in the Kubernetes cluster.

func (*TestHelper) DeleteMemcached

func (tc *TestHelper) DeleteMemcached(name types.NamespacedName)

DeleteMemcached deletes a Memcached instance from the Kubernetes cluster.

func (*TestHelper) GetMemcached

func (tc *TestHelper) GetMemcached(name types.NamespacedName) *memcachedv1.Memcached

GetMemcached waits for and retrieves a Memcached instance from the Kubernetes cluster

func (*TestHelper) GetTransportURL

func (tc *TestHelper) GetTransportURL(name types.NamespacedName) *rabbitmqv1.TransportURL

GetTransportURL retrieves a TransportURL resource with the specified name.

Example usage:

th.GetTransportURL(types.NamespacedName{Name: "test-transporturl", Namespace: "test-namespace"})

func (*TestHelper) SimulateMemcachedReady

func (tc *TestHelper) SimulateMemcachedReady(name types.NamespacedName)

SimulateMemcachedReady simulates a ready state for a Memcached instance in a Kubernetes cluster.

func (*TestHelper) SimulateTransportURLReady

func (tc *TestHelper) SimulateTransportURLReady(name types.NamespacedName)

SimulateTransportURLReady function retrieves the TransportURL and simulates the readiness of a TransportURL resource.

Example usage:

th.SimulateTransportURLReady(types.NamespacedName{Name: "test-transporturl", Namespace: "test-namespace"})

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL