feat: remove product config & clean up#945
Open
maltesander wants to merge 15 commits into
Open
Conversation
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>
16 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Definition of Done Checklist
Author
Reviewer
Acceptance
type/deprecationlabel & add to the deprecation scheduletype/experimentallabel & add to the experimental features tracker