Skip to content

Operator: Scaffold Go project with Operator SDK and define Experiment CRD types #28

@fmallmann

Description

@fmallmann

Parent Issue

Part of #27

Description

Bootstrap the Go operator project using Operator SDK and define the Experiment CRD API types.

Scope

  • Initialize Go module with operator-sdk init (domain agentic-layer.ai, group testbench)
  • Create the Experiment API type (v1alpha1) with operator-sdk create api
  • Define all Go structs:
    • ExperimentSpec: agentRef, dataset, llmAsAJudgeModel, defaultThreshold, scenarios, trigger
    • AgentRef: name, namespace
    • DatasetSource: s3 (bucket, key), url
    • Scenario, Step, Metric, Reference, ToolCall structs
    • TriggerSpec: enabled, event, concurrencyPolicy
  • Define ExperimentStatus struct with conditions, generatedResources, lastExecution
  • Add kubebuilder validation markers:
    • defaultThreshold and metric threshold validated to 0-1 range
    • dataset and scenarios mutually exclusive (CEL validation rule)
    • Required fields marked appropriately
  • Generate CRD manifests with make manifests
  • Basic Makefile targets: build, manifests, generate, docker-build

Acceptance Criteria

  • operator/ directory with working Go module
  • api/v1alpha1/experiment_types.go with all struct definitions
  • CRD YAML generated in operator/config/crd/bases/
  • OpenAPI validation for threshold ranges and mutual exclusivity
  • go build ./... passes
  • make manifests generates valid CRD

References

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

Status

In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions