Help us shape the future of Go! Take the 2026 Go Developer Survey

helpers

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2025 License: Apache-2.0 Imports: 9 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) AssertCertDoesNotExist

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

AssertCertDoesNotExist ensures the Certificate resource does not exist in a k8s cluster.

func (*TestHelper) AssertIssuerDoesNotExist

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

AssertIssuerDoesNotExist ensures the Issuer resource does not exist in a k8s cluster.

func (*TestHelper) CreateIssuer

func (tc *TestHelper) CreateIssuer(name types.NamespacedName) client.Object

CreateIssuer creates a new Issuer resource with the provided data.

Example usage:

cm := th.CreateIssuer(types.NamespacedName{Namespace: "default", Name: "example-configmap"})

func (*TestHelper) GetCert

GetCert waits for and retrieves a Certificate resource from the Kubernetes cluster

Example:

cert := th.GetCert(types.NamespacedName{Name: "my-issuer", Namespace: "my-namespace"})

func (*TestHelper) GetIssuer

func (tc *TestHelper) GetIssuer(name types.NamespacedName) *certmgrv1.Issuer

GetIssuer waits for and retrieves a Issuer resource from the Kubernetes cluster

Example:

issuer := th.GetIssuer(types.NamespacedName{Name: "my-issuer", Namespace: "my-namespace"})

Jump to

Keyboard shortcuts

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