Commit 13beda3
feat: remove product config & clean up (#842)
* chore: Switch stackable-operator to smooth-operator branch
Point operator-rs to the smooth-operator branch (which exposes the v2::
framework module) and bump tokio to 1.52 and clap to 4.6. This is the
foundation for removing the product-config dependency; existing
product-config code still compiles and all tests pass.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* refactor: Replace product-config validation with ValidatedCluster
Rewrite the validate step to produce a typed `ValidatedCluster` (name, image,
role_group_configs) instead of the product-config `ValidatedRoleConfigByPropertyKind`.
OPA never used product-config for actual config content: `compute_env/cli/files`
all returned empty maps, so the validated role config only served to enumerate
role groups and to feed the DaemonSet's env vars (which were just merged
`envOverrides`).
- validate() no longer takes a ProductConfigManager; it merges config via the
existing `OpaCluster::merged_config()` and resolves the cluster name into the
v2 `ClusterName` type.
- reconcile_opa iterates `role_group_configs` and sources the merged config from
there.
- The DaemonSet builder drops the `server_config` PropertyNameKind map parameter
and merges role/role-group `envOverrides` inline, mirroring how `cliOverrides`
were already merged.
- Remove ProductConfigManager from Ctx and main.rs; the CLI argument is kept but
ignored for backwards compatibility.
- Derive Ord/PartialOrd on OpaRole so it can key the role_group_configs BTreeMap.
The product-config crate dependency and the now-unused Configuration /
KeyValueOverridesProvider impls are removed in a follow-up commit.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* refactor: Extract config_map build step and adopt v2 configOverrides
Move the rolegroup ConfigMap and `config.json` building out of the controller
into a dedicated `controller/build/config_map.rs`. The build step now takes the
`ValidatedCluster` and only uses the `OpaCluster` for the owner reference and
object metadata, no longer reading `spec` for config content.
To carry the merged `configOverrides` through `ValidatedCluster`, migrate
`OpaConfigOverrides.config_json` from the non-mergeable
`config_overrides::JsonConfigOverrides` to the v2
`JsonOrKeyValueConfigOverrides`, which:
- implements `Merge`, so role- and role-group-level overrides are merged once in
the validate step (role group wins) and stored on `OpaRoleGroupConfig`;
- preserves the previous apply order (role patch first, then role group on top)
via the v2 `JsonConfigOverrides` sequence;
- applies infallibly, removing the config-override error path;
- is CRD-safe (raw object schema), unlike the v2 `JsonConfigOverrides` enum whose
`JsonPatch` variant cannot be rendered into a structural CRD schema.
`ValidatedCluster` gains a `cluster_config` holding `user_info` so the ConfigMap
build no longer needs the raw spec for `user-info-fetcher.json`.
Add unit tests covering the default `config.json` and role/role-group override
precedence. Regenerate extra/crds.yaml.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* refactor: Remove the product-config dependency
Drop the now-dead `impl Configuration for OpaConfigFragment` and
`impl KeyValueOverridesProvider for OpaConfigOverrides` (both no-ops kept only to
satisfy the product-config pipeline, which is no longer used), and remove the
`product-config` crate from the workspace and operator-binary manifests.
OPA never derived real config from product-config, so nothing is lost. The empty
`deploy/config-spec/properties.yaml` is kept (it is still mounted by the Docker
image and Helm chart) and normalized to match the other operators.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* refactor: Split config file building into build/properties
Introduce `controller/build/properties/` with one build step per config file and
a `ConfigFileName` enum, mirroring trino/hdfs (adapted for OPA's JSON files, so
the builders return serialized `String`s and there is no key-value writer).
- `properties/config_json.rs`: the `config.json` builder (the former
`build_config_file` plus the `OpaClusterConfigFile` struct family) with its own
error type and the default/override-precedence unit tests.
- `properties/user_info_fetcher.rs`: serializes `user-info-fetcher.json`.
- `properties/mod.rs`: the `ConfigFileName` enum and a shared
`test_support::validated_cluster_from_spec` helper.
- `config_map.rs` shrinks to metadata + dispatch + assembly, wrapping the
per-file builder errors.
The Vector config file keeps coming from the existing logging call for now; it is
folded into the build step in a follow-up commit.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* refactor: Fold product_logging into the build step
Move the Vector config building and the `BundleBuilderLogLevel` mapping out of the
top-level `product_logging` module into `controller/build/properties/logging.rs`,
mirroring hdfs. `build_vector_config` returns `Option<String>` (the agent config or
`None` when disabled) and is infallible, so the dead `InvalidLoggingConfig` error
path is dropped. The DaemonSet now imports `BundleBuilderLogLevel` from the build
module, and the standalone `product_logging.rs` is removed.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* refactor: Fold discovery into the build step (ValidatedCluster)
Move discovery.rs into controller/build/discovery.rs and refactor
build_discovery_config_map to take the ValidatedCluster + role Service +
cluster_info, reading the TLS scheme/port and secret class from
cluster_config and the app version from the resolved image. The owner object
is used only for the owner reference and object metadata.
ValidatedClusterConfig gains a `tls` field (alongside `user_info`), mirroring
trino/hdfs. The discovery ConfigMap name now comes from `cluster.name`, which
finally consumes that field and removes its `#[allow(dead_code)]`.
Adds unit tests asserting the discovery URL (http/https + port) and the
OPA_SECRET_CLASS entry with and without TLS.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix: run linters
* docs: remove product config from cli & env
* fix: linter, regenerate hashes
* fix(deps): use reqwest 0.13 default features to keep native-tls behavior
* fix(test): reduce cluster name length
* chore: adapt changelog
* fix: remove obsolete method.
* refactor: use namespace, uid in ValidatedCluster for ownerrefs.
* refactor: switch to v2 upstream role_utils
* fix: update hashes
* bumped op-rs, moved validated structs to controller/mod.rs, renamed controller.rs -> opa_controller.rs
* fix: remove comments referencing other products / product-config
* refactor: use RoleGroupName & improve ownerref
* fix(tests): shorten rolegroup length
* refactor: switch to v2 types, ResourceNAmes, RoleGroupName, reduce RoleGroupRef, cleanup
* refactor: move k8s resources to controller/build/resource
* refactor: consolidate constants & cleanup
* refactor: use new container builder
* refactor: adapt to v2 logging and add vector test
* refactor: remove raw opacluster dependencies
* test: add unit tests for daemonset and service & validation
* fix: liveness/readiness probe path
* chore: bumo dependencies
* refactor: use v2 ConfigMapName, SecretName, ListenerName
* refactor: use v2 cluster resources new
* refactor: use v2 Port
* chore: bump dependencies
* fix: use framework metrics service; use framework log dir; remove stale comments
* refactor: consolidate containers & logging
* refactor: remove enable_vector_agent from ValidatedLogging, add is_tls_enabled helper
* Revert "fix(tests): shorten rolegroup length"
This reverts commit 09d7646.
* Revert "fix(test): reduce cluster name length"
This reverts commit b87d67d.
* docs: consolidate v2 / upstream refs
* refactor: use obhect meta builder
* fix: use rolegroup global and discovery placeholders
* fix: remove hardcoded filenames for ConfigFileName enum, remove hardcoded constants
* fix: use loop for mkdir, remove clone
* fix: cleanup visibility & remove Deserialize derive
* fix: drop vector_config from build_config_map
* test: add unit tests
* bump op-rs to 0.112.0
* fix: use v2 daemonset name & prometheus annotations and label helper
* chore: remove smooth operator comment
* deps: update anyhow for RUSTSEC-2026-0190
* fix: use JsonConfigOverrides instead of JsonOrKeyValueConfigOverrides
* test: add JsonPatch and UserProvided checks
* docs: add JsonPatch and UserProvided config override examples
* chore: bump stackable-operator to 0.113.2
* bump to op-rs 0.113.3
* regenerate nix/charts
* changelog
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Andrew Kenworthy <andrew.kenworthy@stackable.tech>1 parent 28abcbe commit 13beda3
42 files changed
Lines changed: 5280 additions & 4957 deletions
File tree
- deploy
- config-spec
- helm/opa-operator/configs
- docs/modules/opa/pages
- reference
- usage-guide
- extra
- rust
- operator-binary
- src
- controller
- build
- properties
- product_logging
- resource
- crd
- user_info_fetcher
- operations
- user-info-fetcher/src
- tests/templates/kuttl/smoke
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
22 | 25 | | |
23 | 26 | | |
24 | 27 | | |
| |||
32 | 35 | | |
33 | 36 | | |
34 | 37 | | |
| 38 | + | |
35 | 39 | | |
36 | 40 | | |
37 | 41 | | |
| |||
0 commit comments