Documentation ¶
Index ¶
- type TestHelper
- func (tc *TestHelper) AssertCertDoesNotExist(name types.NamespacedName)
- func (tc *TestHelper) AssertIssuerDoesNotExist(name types.NamespacedName)
- func (tc *TestHelper) CreateIssuer(name types.NamespacedName) client.Object
- func (tc *TestHelper) GetCert(name types.NamespacedName) *certmgrv1.Certificate
- func (tc *TestHelper) GetIssuer(name types.NamespacedName) *certmgrv1.Issuer
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 ¶
func (tc *TestHelper) GetCert(name types.NamespacedName) *certmgrv1.Certificate
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"})
Click to show internal directories.
Click to hide internal directories.