cncf

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package cncf renders CNCF AI Conformance evidence markdown from CTRF reports.

Index

Constants

View Source
const SkippedNoClusterStatus = "skipped - no-cluster mode (test mode)"

SkippedNoClusterStatus is the section status emitted when the collector runs in --no-cluster mode (test mode). Mirrors the validator idiom for consistency across CNCF submission tooling.

Variables

View Source
var FeatureDescriptions = map[string]string{
	// contains filtered or unexported fields
}

FeatureDescriptions maps feature names to human-readable descriptions.

View Source
var ValidFeatures = []string{
	featureDRASupport,
	featureGangScheduling,
	featureSecureAccess,
	featureAcceleratorMetrics,
	featureAIServiceMetrics,
	featureInferenceGateway,
	featureRobustOperator,
	featurePodAutoscaling,
	featureClusterAutoscaling,
}

ValidFeatures lists all supported evidence collection features. These are the user-facing names shown in help text and used with --feature.

Functions

func GetRequirement

func GetRequirement(validatorName string) *requirementMeta

GetRequirement returns the requirement metadata for a validator name. Returns nil if the validator is not a submission-required conformance check.

func IsValidFeature

func IsValidFeature(name string) bool

IsValidFeature returns true if the name is a valid feature or alias.

func ResolveFeature

func ResolveFeature(name string) string

ResolveFeature returns the canonical feature name, resolving aliases.

func ScriptSection

func ScriptSection(feature string) string

ScriptSection returns the script section name for a feature.

Types

type Collector

type Collector struct {
	// contains filtered or unexported fields
}

Collector orchestrates behavioral evidence collection by invoking the embedded collect-evidence.sh script against a live Kubernetes cluster.

func NewCollector

func NewCollector(outputDir string, opts ...CollectorOption) *Collector

NewCollector creates a new evidence Collector.

func (*Collector) Run

func (c *Collector) Run(ctx context.Context) error

Run executes evidence collection for the configured features.

In --no-cluster mode the call short-circuits, logging a skip per section using the validator idiom and returning nil.

On a real run, Run probes for required binaries (bash, kubectl) once, then iterates configured sections under a per-section timeout. Errors from individual sections are aggregated; Run returns a single wrapped error containing the failing section names.

type CollectorOption

type CollectorOption func(*Collector)

CollectorOption configures the Collector.

func WithFeatures

func WithFeatures(features []string) CollectorOption

WithFeatures sets which features to collect evidence for. If empty, all features are collected.

func WithKubeconfig

func WithKubeconfig(kubeconfig string) CollectorOption

WithKubeconfig sets the kubeconfig path for kubectl commands in the evidence script.

func WithNoCleanup

func WithNoCleanup(noCleanup bool) CollectorOption

WithNoCleanup skips test namespace cleanup after collection.

func WithNoCluster

func WithNoCluster(noCluster bool) CollectorOption

WithNoCluster enables test mode: Run short-circuits without invoking any subprocess. Used by unit tests and `aicr --no-cluster` flows.

type Option

type Option func(*Renderer)

Option configures a Renderer.

func WithOutputDir

func WithOutputDir(dir string) Option

WithOutputDir sets the output directory for evidence files.

type Renderer

type Renderer struct {
	// contains filtered or unexported fields
}

Renderer generates CNCF conformance evidence documents from CTRF reports.

func New

func New(opts ...Option) *Renderer

New creates a new evidence Renderer with the given options.

func (*Renderer) Render

func (r *Renderer) Render(ctx context.Context, report *ctrf.Report) error

Render generates evidence markdown files from a CTRF report. Groups test results by CNCF requirement. Only submission-required checks produce evidence. Skipped tests are excluded.

Jump to

Keyboard shortcuts

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