Documentation
¶
Index ¶
- func CheckAcceleratedSelectorMissing(ctx context.Context, componentName string, recipeResult *recipe.RecipeResult, ...) ([]string, []error)
- func CheckHostMofedWithoutNetworkOperator(ctx context.Context, componentName string, recipeResult *recipe.RecipeResult, ...) ([]string, []error)
- func CheckWildcardAcceleratedToleration(ctx context.Context, componentName string, recipeResult *recipe.RecipeResult, ...) ([]string, []error)
- func CheckWorkloadSelectorMissing(ctx context.Context, componentName string, recipeResult *recipe.RecipeResult, ...) ([]string, []error)
- func GetAll() []string
- func Register(name string, fn ValidationFunc)
- func RunValidations(ctx context.Context, componentName string, ...) (warnings []string, errors []error)
- type ValidationFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckAcceleratedSelectorMissing ¶
func CheckAcceleratedSelectorMissing(ctx context.Context, componentName string, recipeResult *recipe.RecipeResult, bundlerConfig *config.Config, conditions map[string][]string) ([]string, []error)
CheckAcceleratedSelectorMissing checks if accelerated-node-selector is missing when conditions are met. This is a generic check that can be used by any component.
func CheckHostMofedWithoutNetworkOperator ¶ added in v0.13.0
func CheckHostMofedWithoutNetworkOperator(ctx context.Context, componentName string, recipeResult *recipe.RecipeResult, bundlerConfig *config.Config, conditions map[string][]string) ([]string, []error)
CheckHostMofedWithoutNetworkOperator warns when network-operator is disabled via --set but gpu-operator still has driver.rdma.useHostMofed=true (the AKS default). Without network-operator, no host MOFED is present and useHostMofed should be set to false.
func CheckWildcardAcceleratedToleration ¶ added in v0.17.0
func CheckWildcardAcceleratedToleration(ctx context.Context, componentName string, recipeResult *recipe.RecipeResult, bundlerConfig *config.Config, conditions map[string][]string) ([]string, []error)
CheckWildcardAcceleratedToleration reports when the effective accelerated-node tolerations for a component include a wildcard (keyless operator: Exists) toleration. Scope it via registry conditions to services where the wildcard is harmful — on AKS, admission collapses a pod's toleration list to just the wildcard when one is present, which defeats the nodewright operator's drain exemption for its own package pods and deadlocks packages that declare interrupts (NVIDIA/nodewright#296). That deadlock requires manual node cordon/reboot to recover, so the registry wires this at severity: error to block the bundle until a keyed toleration is supplied.
The default bundle path always hits this: with no --accelerated-node-toleration flag the CLI falls back to snapshotter.DefaultTolerations() (a single bare operator: Exists). An empty toleration list is flagged too, because the tuning manifest template renders its own wildcard fallback when none are injected.
A component disabled via --set (e.g. the documented RDMA opt-out --set nodewrightcustomizations:enabled=false) renders no package pods and cannot deadlock, so it is skipped regardless of the toleration shape.
func CheckWorkloadSelectorMissing ¶
func CheckWorkloadSelectorMissing(ctx context.Context, componentName string, recipeResult *recipe.RecipeResult, bundlerConfig *config.Config, conditions map[string][]string) ([]string, []error)
CheckWorkloadSelectorMissing checks if workload-selector is missing when conditions are met. This is a generic check that can be used by any component.
func Register ¶
func Register(name string, fn ValidationFunc)
Register adds a validation function to the registry. This allows components to register custom validation functions. It's also called from init() functions in check files for auto-registration.
func RunValidations ¶
func RunValidations(ctx context.Context, componentName string, validations []recipe.ComponentValidationConfig, recipeResult *recipe.RecipeResult, bundlerConfig *config.Config) (warnings []string, errors []error)
RunValidations executes all validations for a component and returns warnings and errors. The optional message from the validation config is appended to each warning/error. Severity determines whether check results become warnings or errors.
Types ¶
type ValidationFunc ¶
type ValidationFunc func(ctx context.Context, componentName string, recipeResult *recipe.RecipeResult, bundlerConfig *config.Config, conditions map[string][]string) (warnings []string, errors []error)
ValidationFunc is the signature for validation check functions. Parameters:
- ctx: Context for cancellation/timeout
- componentName: Name of the component being validated
- recipeResult: The recipe result containing component refs and criteria
- bundlerConfig: The bundler configuration (for accessing flags like workload-selector)
- conditions: Conditions from the validation config (e.g., {"intent": ["training"]} or {"intent": ["training", "inference"]})
Returns:
- warnings: List of warning messages (non-blocking)
- errors: List of error messages (blocking)
func Get ¶
func Get(name string) ValidationFunc
Get returns a validation function by name. Returns nil if the function is not found.