secrets

package
v1.20.2 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package secrets holds verification helpers for the Secret references that object CRDs publish in their status, shared by more than one object test package. Verification helpers for a different resource belong in a package named for that resource, not here.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertRefs

func AssertRefs(ctx context.Context, t *testing.T, k8sh *utils.K8sHelper, refs []cephv1.SecretReference, expected ...*corev1.Secret)

AssertRefs verifies that refs contains exactly one SecretReference per expected Secret and that each matches the live secret's Name, Namespace, UID, and ResourceVersion. Live secrets are fetched from each expected secret's own namespace.

func RequireStatusRefs

func RequireStatusRefs[T, L runtime.Object](
	t *testing.T,
	k8sh *utils.K8sHelper,
	client wait4.NamespacedWatcher[T, L],
	name, desc string,
	refsOf func(T) []cephv1.SecretReference,
	expected ...*corev1.Secret,
)

RequireStatusRefs runs a subtest named desc that waits for the status secret references returned by refsOf to reach len(expected) — the controller repopulates them asynchronously after a reconcile — and then asserts each ref against its live secret via AssertRefs. refsOf must tolerate an unpopulated status (return nil).

Types

This section is empty.

Jump to

Keyboard shortcuts

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