chore!: Remove NiFi 1.x configuration CRD fields #954
Open
sbernauer wants to merge 3 commits into
Open
Conversation
Member
Author
NickLarsenNZ
reviewed
Jul 1, 2026
NickLarsenNZ
reviewed
Jul 1, 2026
Member
There was a problem hiding this comment.
I assume this is ok to just remove. I can't think of another way, and the config is no longer supported, so I guess it is fine.
Member
Author
There was a problem hiding this comment.
I agree. I was also thinking of using CRD versioning, but IIRC we only support renames so far
Member
Author
There was a problem hiding this comment.
We could deprecate it, but are we then keeping it forever? We will discuss in the team with @Techassi as well
Co-authored-by: Nick <10092581+NickLarsenNZ@users.noreply.github.com>
Member
Author
|
Just dumping a spike for v1alpha2 with a deprecation diffdiff --git a/rust/operator-binary/src/crd/mod.rs b/rust/operator-binary/src/crd/mod.rs
index 8ce0d8c..3a89c5e 100644
--- a/rust/operator-binary/src/crd/mod.rs
+++ b/rust/operator-binary/src/crd/mod.rs
@@ -27,7 +27,10 @@ use stackable_operator::{
config_overrides::{KeyValueConfigOverrides, KeyValueOverridesProvider},
crd::{authentication::core as auth_core, git_sync},
deep_merger::ObjectOverrides,
- k8s_openapi::{api::core::v1::Volume, apimachinery::pkg::api::resource::Quantity},
+ k8s_openapi::{
+ api::core::v1::{PodTemplateSpec, Volume},
+ apimachinery::pkg::api::resource::Quantity,
+ },
kube::{CustomResource, ResourceExt, runtime::reflector::ObjectRef},
memory::MemoryQuantity,
product_config_utils::{self, Configuration},
@@ -36,7 +39,7 @@ use stackable_operator::{
schemars::{self, JsonSchema},
shared::time::Duration,
status::condition::{ClusterCondition, HasStatusCondition},
- utils::crds::raw_object_list_schema,
+ utils::crds::{raw_object_list_schema, raw_object_schema},
versioned::versioned,
};
use tls::NifiTls;
@@ -73,6 +76,7 @@ pub enum Error {
#[versioned(
version(name = "v1alpha1"),
+ version(name = "v1alpha2"),
crates(
kube_core = "stackable_operator::kube::core",
kube_client = "stackable_operator::kube::client",
@@ -162,6 +166,11 @@ pub mod versioned {
#[serde(default, skip_serializing_if = "Vec::is_empty")]
#[schemars(schema_with = "raw_object_list_schema")]
pub extra_volumes: Vec<Volume>,
+
+ // Docs are on the struct
+ #[serde(default)]
+ #[versioned(deprecated(since = "v1alpha2"))]
+ pub deprecated_create_reporting_task_job: CreateReportingTaskJob,
}
// This is flattened in for backwards compatibility reasons, `zookeeper_config_map_name` already existed and used to be mandatory.
@@ -306,6 +315,43 @@ pub fn default_allow_all() -> bool {
true
}
+/// This section creates a `create-reporting-task` Kubernetes Job, which enables the export of
+/// Prometheus metrics within NiFi.
+#[derive(Clone, Debug, Deserialize, JsonSchema, PartialEq, Serialize)]
+#[serde(rename_all = "camelCase")]
+pub struct CreateReportingTaskJob {
+ /// Whether the Kubernetes Job should be created, defaults to true. It can be helpful to disable
+ /// the Job, e.g. when you configOverride an authentication mechanism, which the Job currently
+ /// can't use to authenticate against NiFi.
+ #[serde(default = "CreateReportingTaskJob::default_enabled")]
+ pub enabled: bool,
+
+ /// Here you can define a
+ /// [PodTemplateSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#podtemplatespec-v1-core)
+ /// to override any property that can be set on the Pod of the create-reporting-task Kubernetes Job.
+ /// Read the
+ /// [Pod overrides documentation](DOCS_BASE_URL_PLACEHOLDER/concepts/overrides#pod-overrides)
+ /// for more information.
+ #[serde(default)]
+ #[schemars(schema_with = "raw_object_schema")]
+ pub pod_overrides: PodTemplateSpec,
+}
+
+impl Default for CreateReportingTaskJob {
+ fn default() -> Self {
+ Self {
+ enabled: Self::default_enabled(),
+ pod_overrides: Default::default(),
+ }
+ }
+}
+
+impl CreateReportingTaskJob {
+ const fn default_enabled() -> bool {
+ true
+ }
+}
+
#[derive(strum::Display)]
#[strum(serialize_all = "camelCase")]
pub enum NifiRole {
@@ -543,11 +589,14 @@ fn node_default_listener_class() -> String {
mod tests {
use stackable_operator::versioned::test_utils::RoundtripTestData;
- use super::v1alpha1;
+ use super::{v1alpha1, v1alpha2};
- impl RoundtripTestData for v1alpha1::NifiClusterSpec {
- fn roundtrip_test_data() -> Vec<Self> {
- stackable_operator::utils::yaml_from_str_singleton_map(indoc::indoc! {r#"
+ /// The v1alpha1 and v1alpha2 specs are identical apart from the reporting task job field, which
+ /// is called `createReportingTaskJob` in v1alpha1 and `deprecatedCreateReportingTaskJob` in
+ /// v1alpha2. The differing name is templated in via `{{reporting_task_job_field}}` so that the
+ /// YAML can be shared between both versions.
+ fn nifi_cluster_roundtrip_test_data(reporting_task_job_field: &str) -> String {
+ indoc::indoc! {r#"
- image:
productVersion: 1.2.3
pullPolicy: IfNotPresent
@@ -564,6 +613,11 @@ mod tests {
- example.com:1234
sensitiveProperties:
keySecret: nifi-sensitive-property-key
+ {{reporting_task_job_field}}:
+ enabled: false
+ podOverrides:
+ spec:
+ securityContext: {}
customComponentsGitSync:
- repo: ssh://git@github.com/stackable-airflow/dags.git
- repo: https://github.com/stackable-airflow/dags
@@ -634,8 +688,25 @@ mod tests {
cpu: 700m
limits:
cpu: 1200m
- "#})
- .expect("Failed to parse NifiClusterSpec YAML")
+ "#}
+ .replace("{{reporting_task_job_field}}", reporting_task_job_field)
+ }
+
+ impl RoundtripTestData for v1alpha1::NifiClusterSpec {
+ fn roundtrip_test_data() -> Vec<Self> {
+ stackable_operator::utils::yaml_from_str_singleton_map(
+ &nifi_cluster_roundtrip_test_data("createReportingTaskJob"),
+ )
+ .expect("Failed to parse v1alpha1 NifiClusterSpec YAML")
+ }
+ }
+
+ impl RoundtripTestData for v1alpha2::NifiClusterSpec {
+ fn roundtrip_test_data() -> Vec<Self> {
+ stackable_operator::utils::yaml_from_str_singleton_map(
+ &nifi_cluster_roundtrip_test_data("deprecatedCreateReportingTaskJob"),
+ )
+ .expect("Failed to parse v1alpha2 NifiClusterSpec YAML")
}
}
}
|
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
Part of stackabletech/docker-images#1498
#944 dropped 1.28.1 from the list of supported version, but we also need to remove all the NiFi 1.x code. This PR does this. Pls note that this removes CRD fields, thus is breaking.
This removes the Prometheus reporting-task Job (and its
spec.clusterConfig.createReportingTaskJobfield), the pre-2.x non-rolling upgrade handling, the dedicated metrics port, and the sensitive-properties algorithms that were only supported on NiFi 1.x.Definition of Done Checklist
Author
Reviewer
Acceptance
type/deprecationlabel & add to the deprecation scheduletype/experimentallabel & add to the experimental features trackerRelease notes
Removed
Dropped support for NiFi 1.x alongside with a few CRD fields that only applied to 1.x and had no effect on NiFi 2.x:
spec.clusterConfig.createReportingTaskJob(incl.enabled,podOverrides) — NiFi 2.x exposes Prometheus metrics directly at/nifi-api/flow/metrics/prometheus, so the reporting-task Job is obsolete.spec.clusterConfig.sensitiveProperties.algorithmvalues, please use an supported algorithm instead:nifiArgon2AesGcm256(default) andnifiPbkdf2AesGcm256