Skip to content

Commit 11e5526

Browse files
adwk67claudesiegfriedweber
authored
refactor: extract dereference/validate pipeline from reconcile_hive (#707)
* refactor: extract dereference/validate pipeline from reconcile_hive Move external resource resolution (product image, S3 connection, metadata database, OPA config) into controller::dereference module with its own error enum. Extract config validation and merging into validate_cluster(), which produces a ValidatedHiveCluster proving all product-config validation succeeded before any Kubernetes resources are created. The validated struct owns the resolved product image and per-role/ per-rolegroup merged configs. Existing build functions are unchanged and receive their parameters from the validated structs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * refactor: extract validate_cluster into controller::validate module Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * refactor: align error variant naming with airflow and hbase operators Rename FailedToResolveResourceConfig to FailedToResolveConfig and fix OPA error display string to match the convention used across all three dereference/validate extraction PRs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * refactor: move product image resolution from dereference to validate Image resolution is a pure computation, not an I/O dereference, so it belongs in validate_cluster alongside the other config validation. This aligns with the pattern used by the trino and airflow operators. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * changelog * Update rust/operator-binary/src/controller.rs Co-authored-by: Siegfried Weber <mail@siegfriedweber.net> * assume single role in ValidatedHiveCluster * move db connection details from dereferenced to the controller and remove derives where they do not exist on the upstream type * move validated cluster to the controller which will be the central dependency for subsequent steps * replace parameter with constant * replace parameter with compile-time value; rename function * pass dereferenced fields through to validation * extend assert step to increase test coverage by checking most generated resources * remove securityContext from assert (might not work on Openshift) * nix update * pass dereferenced struct rather than each field * remove timestmap from assert * move related structs togetherin controller --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Siegfried Weber <mail@siegfriedweber.net>
1 parent e63b953 commit 11e5526

8 files changed

Lines changed: 802 additions & 174 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@ All notable changes to this project will be documented in this file.
1717
This means you need to replace your simple database connection string with a typed struct.
1818
This struct is consistent between different CRDs, so that you can easily copy/paste it between stacklets.
1919
Read on the [Hive database documentation](https://docs.stackable.tech/home/nightly/hive/usage-guide/database-driver) for details ([#674]).
20+
- Internal operator refactoring: introduce dereference() and validate() steps in the reconciler ([#707]).
2021

2122
[#674]: https://github.com/stackabletech/hive-operator/pull/674
2223
[#693]: https://github.com/stackabletech/hive-operator/pull/693
2324
[#695]: https://github.com/stackabletech/hive-operator/pull/695
2425
[#702]: https://github.com/stackabletech/hive-operator/pull/702
26+
[#707]: https://github.com/stackabletech/hive-operator/pull/707
2527

2628
## [26.3.0] - 2026-03-16
2729

Cargo.nix

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crate-hashes.json

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)