Documentation
¶
Overview ¶
Catalog subscription coordinate for registry-backed specs. Operator-local: not part of the byte-identical fixture flow shared with cli (fixtures.sh, fixtures.go, fixtures_test.go), so `task fixtures:lint` does not cover it.
Package fixtures reads the declared coordinate of this repo's published test-fixture modules, so tests pin the version the tree carries instead of a literal that has to be edited on every bump.
IDENTICAL COPY in cli/tests/fixtures/fixtures.go and opm-operator/test/fixtures/fixtures.go. The workspace root `task fixtures:lint` fails when the two drift; edit both.
A fixture lives at <this dir>/modules/<name>/ and its identity package (identity/identity.cue) is the single source of ModulePath and Version. The identity package is import-free by design, so loading it needs no registry and no CUE_REGISTRY mapping. hack/fixtures.sh reads the same two fields with `cue eval ./identity`; this is the Go spelling of that read.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CatalogVersion ¶
func CatalogVersion() string
CatalogVersion is the exact catalog build the registry-backed specs subscribe to (0010:D14: a subscription names one published build; there is no range vocabulary). Overridable via OPM_TEST_CATALOG_VERSION so a fixture republish does not require a code edit; the default tracks the pin in config/samples. Single source for every suite — a catalog bump edits this default once, never a per-suite copy.
Types ¶
type Coordinate ¶
type Coordinate struct {
// ModulePath is the major-suffixed CUE module path, e.g.
// testing.opmodel.dev/modules/operator/hello@v0.
ModulePath string
// Version is the bare SemVer, e.g. 0.0.6.
Version string
}
Coordinate is a fixture's declared module path and bare SemVer version.
func Load ¶
func Load(name string) (Coordinate, error)
Load reads the coordinate of the fixture module <Dir()>/<name>.
func Must ¶
func Must(t Failer, name string) Coordinate
Must is Load for tests: a fixture that cannot be read fails the test.
func (Coordinate) Tag ¶
func (c Coordinate) Tag() string
Tag is the registry tag for the version: "v" + Version.