Skip to content

Extract Validation as standalone portable type from pkg/recipe #732

Description

@xdu31

Description

Extract Validation (currently ValidationConfig in pkg/recipe/metadata.go) as a standalone, portable Go type that can be used in multiple contexts: embedded in recipes, standalone YAML files, or embedded in external data structures.

Context

External consumers want to use AICR's validation types programmatically. To enable this, validation types need to be extracted as portable Go structs that can be embedded or extended in consumer code while remaining usable in AICR's existing recipe system.

Requirements

  1. Extract ValidationConfig as a standalone type (rename to Validation or keep as-is)
  2. Add fields useful for external orchestration:
    • NodeSelector map[string]string - for node targeting
    • ExpectedNewReplicas int - for batch processing
    • Status tracking fields (phase state, check results)
  3. Maintain backward compatibility with existing recipe structure
  4. Ensure JSON/YAML tags are present for serialization
  5. No external dependencies (keep it portable)

Acceptance Criteria

  • Validation type exists as standalone Go struct
  • Type includes nodeSelector and expectedNewReplicas fields
  • Type includes status fields for tracking phase/check state
  • Existing recipe loading continues to work unchanged
  • Type can be embedded via json:",inline" tag
  • Unit tests validate JSON/YAML marshaling/unmarshaling
  • Documentation updated with usage examples

Related

Metadata

Metadata

Assignees

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions