Documentation
¶
Overview ¶
Package builders provides fluent test data builders for creating Kubernetes resources in integration tests.
Feature: CC-0002
Index ¶
- type SecretBuilder
- func (b *SecretBuilder) Build() *corev1.Secret
- func (b *SecretBuilder) WithAnnotations(annotations map[string]string) *SecretBuilder
- func (b *SecretBuilder) WithData(key string, value []byte) *SecretBuilder
- func (b *SecretBuilder) WithLabels(labels map[string]string) *SecretBuilder
- func (b *SecretBuilder) WithOwner(owner metav1.Object, scheme *runtime.Scheme) *SecretBuilder
- func (b *SecretBuilder) WithStringData(key, value string) *SecretBuilder
- func (b *SecretBuilder) WithType(secretType corev1.SecretType) *SecretBuilder
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).