builders

package
v0.0.0-...-8de2fc3 Latest Latest
Warning

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

Go to latest
Published: May 3, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package builders provides fluent test data builders for creating Kubernetes resources in integration tests.

Feature: CC-0002

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SecretBuilder

type SecretBuilder struct {
	// contains filtered or unexported fields
}

SecretBuilder provides a fluent API for constructing corev1.Secret objects in tests.

func NewSecretBuilder

func NewSecretBuilder(name, namespace string) *SecretBuilder

NewSecretBuilder creates a new SecretBuilder with the given name and namespace.

func (*SecretBuilder) Build

func (b *SecretBuilder) Build() *corev1.Secret

Build returns the constructed corev1.Secret. It returns a deep copy to prevent mutation of the builder state.

func (*SecretBuilder) WithAnnotations

func (b *SecretBuilder) WithAnnotations(annotations map[string]string) *SecretBuilder

WithAnnotations sets annotations on the Secret. The provided map is copied to prevent the caller from mutating the builder's internal state.

func (*SecretBuilder) WithData

func (b *SecretBuilder) WithData(key string, value []byte) *SecretBuilder

WithData adds a key-value pair to the Secret's Data field (raw bytes).

func (*SecretBuilder) WithLabels

func (b *SecretBuilder) WithLabels(labels map[string]string) *SecretBuilder

WithLabels sets labels on the Secret. The provided map is copied to prevent the caller from mutating the builder's internal state.

func (*SecretBuilder) WithOwner

func (b *SecretBuilder) WithOwner(owner metav1.Object, scheme *runtime.Scheme) *SecretBuilder

WithOwner sets an owner reference on the Secret.

func (*SecretBuilder) WithStringData

func (b *SecretBuilder) WithStringData(key, value string) *SecretBuilder

WithStringData adds a key-value pair to the Secret's StringData field.

func (*SecretBuilder) WithType

func (b *SecretBuilder) WithType(secretType corev1.SecretType) *SecretBuilder

WithType sets the Secret type (e.g., corev1.SecretTypeOpaque).

Jump to

Keyboard shortcuts

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