Documentation
¶
Overview ¶
Package catalog provides the declarative validator catalog. The catalog defines which validator containers exist, what phase they belong to, and how they should be executed as Kubernetes Jobs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CatalogMetadata ¶
CatalogMetadata contains catalog-level metadata.
type ResourceRequirements ¶
type ResourceRequirements struct {
CPU string `yaml:"cpu,omitempty"`
Memory string `yaml:"memory,omitempty"`
}
ResourceRequirements defines CPU and memory for a validator container.
type ValidatorCatalog ¶
type ValidatorCatalog struct {
APIVersion string `yaml:"apiVersion"`
Kind string `yaml:"kind"`
Metadata CatalogMetadata `yaml:"metadata"`
Validators []ValidatorEntry `yaml:"validators"`
}
ValidatorCatalog is the top-level catalog document.
func Load ¶
func Load(version string) (*ValidatorCatalog, error)
Load reads and parses the embedded catalog.
Image tag resolution (applied in order):
- If a catalog entry uses :latest and version is a release (vX.Y.Z), the tag is replaced with the CLI version for reproducibility.
- If AICR_VALIDATOR_IMAGE_REGISTRY is set, the registry prefix is replaced.
Entries with explicit version tags (e.g., :v1.2.3) are never modified.
func Parse ¶
func Parse(data []byte) (*ValidatorCatalog, error)
Parse parses a catalog from raw YAML bytes. Exported for testing with inline catalogs without depending on the embedded file.
func (*ValidatorCatalog) ForPhase ¶
func (c *ValidatorCatalog) ForPhase(phase string) []ValidatorEntry
ForPhase returns validators filtered by phase name.
type ValidatorEntry ¶
type ValidatorEntry struct {
// Name is the unique identifier for this validator, used in Job names.
Name string `yaml:"name"`
// Phase is the validation phase: "deployment", "performance", or "conformance".
Phase string `yaml:"phase"`
// Description is a human-readable description of what this validator checks.
Description string `yaml:"description"`
// Image is the OCI image reference for the validator container.
Image string `yaml:"image"`
// Timeout is the maximum execution time for this validator.
// Maps to Job activeDeadlineSeconds.
Timeout time.Duration `yaml:"timeout"`
// Args are the container arguments.
Args []string `yaml:"args"`
// Env are environment variables to set in the container.
Env []EnvVar `yaml:"env"`
// Resources specifies container resource requests/limits.
// If nil, defaults from pkg/defaults are used.
Resources *ResourceRequirements `yaml:"resources,omitempty"`
}
ValidatorEntry defines a single validator container.