Skip to content

feat: remove product config & clean up#945

Open
maltesander wants to merge 15 commits into
mainfrom
refactor/remove-product-config
Open

feat: remove product config & clean up#945
maltesander wants to merge 15 commits into
mainfrom
refactor/remove-product-config

Conversation

@maltesander
Copy link
Copy Markdown
Member

Description

  • remove product config
  • move to config map builder step

Definition of Done Checklist

  • Not all of these items are applicable to all PRs, the author should update this template to only leave the boxes in that are relevant
  • Please make sure all these things are done and tick the boxes

Author

  • Changes are OpenShift compatible
  • CRD changes approved
  • CRD documentation for all fields, following the style guide.
  • Helm chart can be installed and deployed operator works
  • Integration tests passed (for non trivial changes)
  • Changes need to be "offline" compatible
  • Links to generated (nightly) docs added
  • Release note snippet added

Reviewer

  • Code contains useful comments
  • Code contains useful logging statements
  • (Integration-)Test cases added
  • Documentation added or updated. Follows the style guide.
  • Changelog updated
  • Cargo.toml only contains references to git tags (not specific commits or branches)

Acceptance

  • Feature Tracker has been updated
  • Proper release label has been added
  • Links to generated (nightly) docs added
  • Release note snippet added
  • Add type/deprecation label & add to the deprecation schedule
  • Add type/experimental label & add to the experimental features tracker

maltesander and others added 14 commits June 3, 2026 20:04
Add [patch] section to Cargo.toml pointing stackable-operator at the
smooth-operator branch of operator-rs (v0.111.1). No import-path
relocations were needed — all existing paths remain valid on this branch.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Vendor the `to_java_properties_string` / `to_hadoop_xml` writers from
`product-config` into `controller::build::properties::writer` so the
operator no longer relies on product-config for config serialization.

Introduce `ConfigFileName` (the enum of NiFi config file names) and
skeleton helpers `defined_entries` / `resolved_overrides` in
`controller::build::properties` — these are dead-code-allowed stubs
that will be wired up in Task 4.

Swap the single existing call site (JVM security properties) to use
the vendored writer; output is byte-identical.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Introduces a typed, merged-per-rolegroup config path using a vendored
trino-style framework/role_utils.rs shim. Adds NifiRoleGroupConfig type
alias, build_role_group_configs() helper, and role_group_configs field to
ValidatedInputs (strangler pattern — old validated_role_config kept intact).

Also adds Merge impl for NifiConfigOverrides and Ord/Eq/Hash derives to
NifiRole to satisfy generic bounds required by with_validated_config.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Rename ValidatedInputs to ValidatedCluster and introduce a nested
ValidatedClusterConfig grouping authentication, authorization, and
proxy_hosts. Add a name field (dead_code for now). Add #[derive(Clone)]
to NifiAuthenticationConfig and ResolvedNifiAuthorizationConfig so
reconcile_nifi can clone fields while keeping the validated binding alive
for later tasks.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Create one build() module per NiFi config file (bootstrap.conf,
nifi.properties, state-management.xml, security.properties,
login-identity-providers.xml, authorizers.xml) behind the ConfigFileName
enum, sourcing user overrides from the typed NifiRoleGroupConfig instead
of the product-config PropertyNameKind::File maps.

Wire the new builders into build_node_rolegroup_config_map, keeping
validated alive in reconcile_nifi and looking up the typed rg per loop
iteration. Add clustering_backend and sensitive_properties_algorithm to
ValidatedClusterConfig; validate the algorithm at the validate() step.
Move bootstrap.conf tests (now byte-identical) to bootstrap_conf.rs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Replace the product-config validated_role_config map as the env-var source
for the rolegroup loop, git-sync, and statefulset builder with the typed
NifiRoleGroupConfig.env_overrides from ValidatedCluster.role_group_configs.

- Loop now iterates node_role_group_configs (typed BTreeMap) directly
- git-sync gets env vars via env_vars_from_overrides(&rg.env_overrides)
- build_node_rolegroup_statefulset takes &NifiRoleGroupConfig instead of
  &HashMap<PropertyNameKind, BTreeMap<String, String>>
- validated_role_config field is now populated but unread; annotated with
  #[allow(dead_code)] pending removal in Task 7
- Removes: nifi_node_config derivation, MissingRoleGroupConfig error,
  ProductConfigKindNotSpecified error, env_vars_from_rolegroup_config import,
  PropertyNameKind and HashMap imports from controller.rs

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Drop the `product-config` crate from workspace and operator-binary
Cargo.toml, delete the now-unused `validated_role_config` field and
`validated_product_config()` pipeline, remove ProductConfigManager from
Ctx and main.rs, empty both properties.yaml files to their stub form,
and apply two small nits (use `nifi_role` binding consistently, drop
stale env-var comment).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add a test_support helper in controller/build/properties.rs for
constructing a minimal ValidatedCluster without Kubernetes API access
(direct construction chosen over validate::validate() because the latter
requires DereferencedAuthenticationClasses fetched from the API).

Tests added:
- nifi_properties: test_stable_keys_present (HTTPS port, cluster node,
  Kubernetes election impl, sensitive-props algorithm, proxy host wildcard)
- nifi_properties: test_config_override_wins (configOverrides flow-through)
- login_identity_providers: test_build_returns_ok_with_expected_structure
- authorizers: test_build_returns_non_empty_xml_with_authorizers_root

Drive-by rename: BuildProductConfig -> BuildNifiProperties (and its
Snafu selector) in config_map.rs to remove the stale product-config name.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <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