Skip to content

feat: rewrite controller as validated pipeline stages#703

Draft
adwk67 wants to merge 3 commits into
mainfrom
feature/validated-config-types
Draft

feat: rewrite controller as validated pipeline stages#703
adwk67 wants to merge 3 commits into
mainfrom
feature/validated-config-types

Conversation

@adwk67
Copy link
Copy Markdown
Member

@adwk67 adwk67 commented May 11, 2026

Note

These PRs are primarily for validating the refactoring process and can be ignored, merged, closed etc. as we see fit.

Summary

  • Adds a framework module with validated string wrapper types, infallible builder helpers, and compile-time name length assertions (ported from opensearch-operator)
  • Rewrites the monolithic controller reconcile function into a five-stage pipeline: dereference → validate → build → apply → update_status
  • The build stage is infallible — all config parsing, merging, and external lookups happen in validate/dereference

Commits

  1. framework macros and types — validated string wrappers, attributed_string_type macro, HasName/HasUid/NameIsValidLabelValue traits
  2. framework builders and utilities — infallible wrappers for labels, PDB, owner references, pod/container construction, product logging, resource names
  3. controller pipeline rewrite — the five pipeline stages, ValidatedHiveCluster, RoleGroupBuilder, unit tests; deletes discovery.rs, service.rs, and operations/

42 files changed, +5993 -1676

Test plan

  • cargo clippy --all-targets — zero warnings
  • cargo test — all tests pass
  • cargo doc --document-private-items — zero doc warnings

🤖 Generated with Claude Code

adwk67 and others added 3 commits May 8, 2026 18:21
Introduce the framework module with compile-time validated string wrapper
types (attributed_string_type macro) and typed Kubernetes/operator name
types. Ported from the opensearch-operator reference implementation.

All code is currently unused and will be wired into the controller in
subsequent commits.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Port remaining framework modules from the opensearch-operator reference:
builder (meta, pdb, pod, statefulset), kvp labels, product logging,
cluster resources, controller utils, role/role-group utilities.

These provide infallible wrappers around stackable-operator builder APIs
and type-safe resource name derivation with compile-time length assertions.
All code is currently unused and will be wired into the controller in the
next commit.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace the monolithic controller with a structured pipeline of
validate → build → apply → update_status stages. Each stage operates
on validated, type-safe data rather than raw CRD types.

Remove discovery.rs, operations/, and service.rs modules whose
logic has been absorbed into the new pipeline. Trim listener.rs
and kerberos.rs to their shared helpers now that pod-building
logic lives in controller/build.rs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant