Documentation
¶
Overview ¶
Package validator provides a container-per-validator execution engine for AICR cluster validation. Each validator is an OCI container image run as a Kubernetes Job, communicating results via exit codes and termination messages.
Index ¶
- Variables
- type Option
- func WithCleanup(cleanup bool) Option
- func WithImagePullSecrets(secrets []string) Option
- func WithNamespace(namespace string) Option
- func WithNoCluster(noCluster bool) Option
- func WithRunID(runID string) Option
- func WithTolerations(tolerations []corev1.Toleration) Option
- func WithVersion(version string) Option
- type Phase
- type PhaseResult
- type Validator
Constants ¶
This section is empty.
Variables ¶
var PhaseOrder = []Phase{PhaseDeployment, PhasePerformance, PhaseConformance}
PhaseOrder defines the mandatory execution order. If a phase fails, subsequent phases are skipped.
Note: Readiness phase is NOT included. It remains in pkg/validator and uses inline constraint evaluation (no containers).
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*Validator)
Option is a functional option for configuring Validator instances.
func WithCleanup ¶
WithCleanup controls whether to delete Jobs, ConfigMaps, and RBAC after validation. Default: true.
func WithImagePullSecrets ¶
WithImagePullSecrets sets image pull secrets for validator Jobs.
func WithNamespace ¶
WithNamespace sets the Kubernetes namespace for validation Jobs. Default: "aicr-validation".
func WithNoCluster ¶
WithNoCluster controls cluster access. When true, all validators are reported as skipped and no K8s API calls are made. Default: false.
func WithRunID ¶
WithRunID sets the RunID for this validation run. Used when resuming a previous run.
func WithTolerations ¶ added in v0.8.2
func WithTolerations(tolerations []corev1.Toleration) Option
WithTolerations sets tolerations for validator Jobs. Default: tolerate-all.
func WithVersion ¶
WithVersion sets the validator version string (typically the CLI version).
type Phase ¶ added in v0.9.0
type Phase string
Phase represents a validation phase.
const ( // PhaseDeployment validates that components are deployed and healthy. PhaseDeployment Phase = "deployment" // PhasePerformance runs GPU performance benchmarks. PhasePerformance Phase = "performance" // PhaseConformance verifies Kubernetes API conformance requirements. PhaseConformance Phase = "conformance" )
type PhaseResult ¶
type PhaseResult struct {
// Phase is the phase that was executed.
Phase Phase
// Status is the overall phase status derived from the CTRF summary.
Status string
// Report is the CTRF report for this phase.
Report *ctrf.Report
// Duration is the wall-clock time for the entire phase.
Duration time.Duration
}
PhaseResult is the outcome of running all validators in a single phase.
type Validator ¶
type Validator struct {
// Version is the validator version (typically the CLI version).
Version string
// Namespace is the Kubernetes namespace for validation Jobs.
Namespace string
// RunID is a unique identifier for this validation run.
RunID string
// Cleanup controls whether to delete Jobs, ConfigMaps, and RBAC after validation.
Cleanup bool
// ImagePullSecrets are secret names for pulling validator images.
ImagePullSecrets []string
// NoCluster controls whether to skip cluster operations (dry-run mode).
NoCluster bool
// Tolerations are applied to validator Jobs for scheduling.
Tolerations []corev1.Toleration
}
Validator orchestrates validation runs using containerized validators.
func (*Validator) ValidatePhase ¶
func (v *Validator) ValidatePhase( ctx context.Context, phase Phase, recipeResult *recipe.RecipeResult, snap *snapshotter.Snapshot, ) (*PhaseResult, error)
ValidatePhase runs a single validation phase.
func (*Validator) ValidatePhases ¶
func (v *Validator) ValidatePhases( ctx context.Context, phases []Phase, recipeResult *recipe.RecipeResult, snap *snapshotter.Snapshot, ) ([]*PhaseResult, error)
ValidatePhases runs the specified phases sequentially. If a phase fails, subsequent phases are skipped. Returns one PhaseResult per phase. Pass nil or empty phases to run all phases.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package catalog provides the declarative validator catalog.
|
Package catalog provides the declarative validator catalog. |
|
Package ctrf provides Go types and utilities for the Common Test Report Format (CTRF).
|
Package ctrf provides Go types and utilities for the Common Test Report Format (CTRF). |
|
Package labels provides shared label constants for validation resources.
|
Package labels provides shared label constants for validation resources. |