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

ddtest

package
v0.24.3-rc1 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package ddtest holds the test helper every controller package uses to prove that wrapping its external client with the drift detection decorator changes nothing for a resource that carries no spec.driftDetection block. It is imported by tests only.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Convert

func Convert[To resource.Managed](t *testing.T, from resource.Managed, to To) To

Convert returns from re-expressed as a To, through its JSON form. It is how a test builds the namespaced twin of a cluster-scoped fixture: both scopes share their field names.

func RequirePassThrough

func RequirePassThrough(t *testing.T, newClient func() managed.ExternalClient, newCR func() resource.Managed)

RequirePassThrough observes a fresh resource through a bare client and through the same kind of client wrapped by the decorator, and fails the test unless the two are indistinguishable: same observation, same error, same resulting resource (spec, status and conditions, ignoring timestamps), and no DriftDetected condition.

newClient must return a new, independent client on every call, and newCR a new resource with no spec.driftDetection block.

Types

This section is empty.

Jump to

Keyboard shortcuts

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