Skip to content

Commit cbdb728

Browse files
authored
chore: bump operator rs 0.67 (#614)
* WIP * WIP * WIP * WIP * Update Cargo.nix * fix built * clippy fix * review fix - default * review fix - update op-rs * use full qualified name for Error * regenerate-nix * Update clap * regenerate charts
1 parent 4e60757 commit cbdb728

24 files changed

+3060
-2814
lines changed

Cargo.lock

+676-570
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.nix

+1,497-1,972
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+6-6
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ repository = "https://github.com/stackabletech/nifi-operator"
1111

1212
[workspace.dependencies]
1313
anyhow = "1.0"
14-
built = { version = "0.6", features = ["chrono", "git2"] }
15-
clap = "4.3"
14+
built = { version = "0.7", features = ["chrono", "git2"] }
15+
clap = "4.5"
1616
fnv = "1.0"
1717
futures = { version = "0.3", features = ["compat"] }
1818
indoc = "2.0"
@@ -23,10 +23,10 @@ semver = "1.0"
2323
serde = { version = "1.0", features = ["derive"] }
2424
serde_json = "1.0"
2525
serde_yaml = "0.9"
26-
snafu = "0.7"
27-
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "0.64.0" }
28-
strum = { version = "0.25", features = ["derive"] }
29-
tokio = { version = "1.29", features = ["full"] }
26+
snafu = "0.8"
27+
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.67.1" }
28+
strum = { version = "0.26", features = ["derive"] }
29+
tokio = { version = "1.37", features = ["full"] }
3030
tracing = "0.1"
3131
xml-rs = "0.8"
3232

crate-hashes.json

+282-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deploy/helm/nifi-operator/crds/crds.yaml

+505-184
Large diffs are not rendered by default.

docs/modules/nifi/pages/usage_guide/index.adoc

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
= Usage guide
22

3-
This section will help you to use various aspects of the Stackable Operator for Apache NiFi. For a general introduction into the operator follow the xref:getting_started/index.adoc[] guide. Below is a general overview of some configuration aspects, have a look at the subpages for details.
3+
This section will help you to use various aspects of the Stackable Operator for Apache NiFi.
4+
For a general introduction into the operator follow the xref:getting_started/index.adoc[] guide.
5+
Below is a general overview of some configuration aspects, have a look at the subpages for details.
46

5-
The cluster is configured via a YAML manifest file. This custom resource specifies the amount of replicas for each role group or role specific configuration like resource requests.
7+
The cluster is configured via a YAML manifest file.
8+
This custom resource specifies the amount of replicas for each role group or role specific configuration like resource requests.
69
The following listing shows an example configuration:
710

811
[source,yaml]

docs/modules/nifi/pages/usage_guide/listenerclass.adoc

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
= Service exposition with ListenerClasses
22

3-
Apache NiFi offers a web UI and an API. The Operator deploys a service called `<name>` (where `<name>` is the name of the NifiCluster) through which NiFi can be reached.
3+
Apache NiFi offers a web UI and an API.
4+
The Operator deploys a service called `<name>` (where `<name>` is the name of the NifiCluster) through which NiFi can be reached.
45

5-
This service can have either the `cluster-internal` or `external-unstable` type. `external-stable` is not supported for NiFi at the moment. Read more about the types in the xref:concepts:service-exposition.adoc[service exposition] documentation at platform level.
6+
This service can have either the `cluster-internal` or `external-unstable` type.
7+
`external-stable` is not supported for NiFi at the moment.
8+
Read more about the types in the xref:concepts:service-exposition.adoc[service exposition] documentation at platform level.
69

710
This is how the listener class is configured:
811

docs/modules/nifi/pages/usage_guide/log-aggregation.adoc

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
= Log aggregation
22

3-
The logs can be forwarded to a Vector log aggregator by providing a discovery
4-
ConfigMap for the aggregator and by enabling the log agent:
3+
The logs can be forwarded to a Vector log aggregator by providing a discovery ConfigMap for the aggregator and by enabling the log agent:
54

65
[source,yaml]
76
----
@@ -14,5 +13,4 @@ spec:
1413
enableVectorAgent: true
1514
----
1615

17-
Further information on how to configure logging, can be found in
18-
xref:concepts:logging.adoc[].
16+
Further information on how to configure logging, can be found in xref:concepts:logging.adoc[].

docs/modules/nifi/pages/usage_guide/writing-to-iceberg-tables.adoc

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
= Writing to Iceberg tables
22

3-
https://iceberg.apache.org/[Apache Iceberg] is a high-performance format for huge analytic tables. Iceberg brings the reliability and simplicity of SQL tables to big data, while making it possible for engines like Spark, Trino, Flink, Presto, Hive and Impala to safely work with the same tables, at the same time.
3+
https://iceberg.apache.org/[Apache Iceberg] is a high-performance format for huge analytic tables.
4+
Iceberg brings the reliability and simplicity of SQL tables to big data, while making it possible for engines like Spark, Trino, Flink, Presto, Hive and Impala to safely work with the same tables, at the same time.
45

56
NiFi supports a `PutIceberg` processor to add rows to an existing Iceberg table https://issues.apache.org/jira/browse/NIFI-10442[starting from version 1.19.0].
67
As of NiFi version `1.23.1` only `PutIceberg` is supported, you need to create and compact your tables with other tools such as Trino or Spark (both included in the SDP).

rust/crd/src/affinity.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,8 @@ mod tests {
8383
)
8484
]))
8585
}),
86-
namespace_selector: None,
87-
namespaces: None,
8886
topology_key: "kubernetes.io/hostname".to_string(),
87+
..Default::default()
8988
},
9089
weight: 70
9190
}

rust/crd/src/authentication.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use stackable_operator::{
1313
pub enum Error {
1414
#[snafu(display("Failed to retrieve AuthenticationClass {authentication_class}"))]
1515
AuthenticationClassRetrieval {
16-
source: stackable_operator::error::Error,
16+
source: stackable_operator::client::Error,
1717
authentication_class: ObjectRef<AuthenticationClass>,
1818
},
1919
#[snafu(display("The nifi-operator does not support running Nifi without any authentication. Please provide a AuthenticationClass to use."))]

rust/crd/src/lib.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use stackable_operator::{
2424
k8s_openapi::{api::core::v1::Volume, apimachinery::pkg::api::resource::Quantity},
2525
kube::{runtime::reflector::ObjectRef, CustomResource, ResourceExt},
2626
memory::{BinaryMultiple, MemoryQuantity},
27-
product_config_utils::{ConfigError, Configuration},
27+
product_config_utils::{self, Configuration},
2828
product_logging::{self, spec::Logging},
2929
role_utils::{GenericRoleConfig, Role, RoleGroupRef},
3030
schemars::{self, JsonSchema},
@@ -382,15 +382,15 @@ impl Configuration for NifiConfigFragment {
382382
&self,
383383
_resource: &Self::Configurable,
384384
_role_name: &str,
385-
) -> Result<BTreeMap<String, Option<String>>, ConfigError> {
385+
) -> Result<BTreeMap<String, Option<String>>, product_config_utils::Error> {
386386
Ok(BTreeMap::new())
387387
}
388388

389389
fn compute_cli(
390390
&self,
391391
_resource: &Self::Configurable,
392392
_role_name: &str,
393-
) -> Result<BTreeMap<String, Option<String>>, ConfigError> {
393+
) -> Result<BTreeMap<String, Option<String>>, product_config_utils::Error> {
394394
Ok(BTreeMap::new())
395395
}
396396

@@ -399,7 +399,7 @@ impl Configuration for NifiConfigFragment {
399399
_resource: &Self::Configurable,
400400
_role_name: &str,
401401
_file: &str,
402-
) -> Result<BTreeMap<String, Option<String>>, ConfigError> {
402+
) -> Result<BTreeMap<String, Option<String>>, product_config_utils::Error> {
403403
Ok(BTreeMap::new())
404404
}
405405
}

rust/operator-binary/build.rs

+1-11
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
1-
use std::path::PathBuf;
2-
31
fn main() {
4-
let out_dir = PathBuf::from(std::env::var("OUT_DIR").expect("OUT_DIR is required"));
5-
built::write_built_file_with_opts(
6-
// built's env module depends on a whole bunch of variables that crate2nix doesn't provide
7-
// so we grab the specific env variables that we care about out ourselves instead.
8-
built::Options::default().set_env(false),
9-
"Cargo.toml".as_ref(),
10-
&out_dir.join("built.rs"),
11-
)
12-
.unwrap();
2+
built::write_built_file().unwrap();
133
}

rust/operator-binary/src/config.rs

+9-5
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,19 @@ impl NifiRepository {
6767
pub enum Error {
6868
#[snafu(display("Invalid product config"))]
6969
InvalidProductConfig {
70-
source: stackable_operator::error::Error,
70+
source: stackable_operator::product_config_utils::Error,
71+
},
72+
#[snafu(display("Invalid memory config"))]
73+
InvalidMemoryConfig {
74+
source: stackable_operator::memory::Error,
7175
},
7276
#[snafu(display("Failed to transform product configs"))]
7377
ProductConfigTransform {
74-
source: stackable_operator::product_config_utils::ConfigError,
78+
source: stackable_operator::product_config_utils::Error,
7579
},
7680
#[snafu(display("failed to calculate storage quota for {repo} repository"))]
7781
CalculateStorageQuota {
78-
source: stackable_operator::error::Error,
82+
source: stackable_operator::memory::Error,
7983
repo: NifiRepository,
8084
},
8185
}
@@ -106,13 +110,13 @@ pub fn build_bootstrap_conf(
106110
tracing::debug!("Read {:?} from crd as memory limit", heap_size_definition);
107111

108112
let heap_size = MemoryQuantity::try_from(heap_size_definition)
109-
.context(InvalidProductConfigSnafu)?
113+
.context(InvalidMemoryConfigSnafu)?
110114
.scale_to(BinaryMultiple::Mebi)
111115
* JAVA_HEAP_FACTOR;
112116

113117
let java_heap = heap_size
114118
.format_for_java()
115-
.context(InvalidProductConfigSnafu)?;
119+
.context(InvalidMemoryConfigSnafu)?;
116120

117121
tracing::debug!(
118122
"Converted {:?} to {} for java heap config",

rust/operator-binary/src/controller.rs

+43-27
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,12 @@ use stackable_nifi_crd::{
2222
};
2323
use stackable_operator::{
2424
builder::{
25-
resources::ResourceRequirementsBuilder, ConfigMapBuilder, ContainerBuilder,
26-
ObjectMetaBuilder, PodBuilder, PodSecurityContextBuilder, SecretFormat,
25+
configmap::ConfigMapBuilder,
26+
meta::ObjectMetaBuilder,
27+
pod::{
28+
container::ContainerBuilder, resources::ResourceRequirementsBuilder,
29+
security::PodSecurityContextBuilder, volume::SecretFormat, PodBuilder,
30+
},
2731
},
2832
client::Client,
2933
cluster_resources::{ClusterResourceApplyStrategy, ClusterResources},
@@ -113,33 +117,38 @@ pub enum Error {
113117

114118
#[snafu(display("failed to create cluster resources"))]
115119
CreateClusterResources {
116-
source: stackable_operator::error::Error,
120+
source: stackable_operator::cluster_resources::Error,
117121
},
118122

119123
#[snafu(display("failed to delete orphaned resources"))]
120124
DeleteOrphanedResources {
121-
source: stackable_operator::error::Error,
125+
source: stackable_operator::cluster_resources::Error,
122126
},
123127

124128
#[snafu(display("failed to apply global Service"))]
125129
ApplyRoleService {
126-
source: stackable_operator::error::Error,
130+
source: stackable_operator::cluster_resources::Error,
131+
},
132+
133+
#[snafu(display("failed to fetch deployed StatefulSets"))]
134+
FetchStatefulsets {
135+
source: stackable_operator::client::Error,
127136
},
128137

129138
#[snafu(display("failed to update status"))]
130139
StatusUpdate {
131-
source: stackable_operator::error::Error,
140+
source: stackable_operator::client::Error,
132141
},
133142

134143
#[snafu(display("failed to apply Service for {}", rolegroup))]
135144
ApplyRoleGroupService {
136-
source: stackable_operator::error::Error,
145+
source: stackable_operator::cluster_resources::Error,
137146
rolegroup: RoleGroupRef<NifiCluster>,
138147
},
139148

140149
#[snafu(display("failed to build ConfigMap for {}", rolegroup))]
141150
BuildRoleGroupConfig {
142-
source: stackable_operator::error::Error,
151+
source: stackable_operator::builder::configmap::Error,
143152
rolegroup: RoleGroupRef<NifiCluster>,
144153
},
145154

@@ -148,46 +157,49 @@ pub enum Error {
148157

149158
#[snafu(display("failed to apply ConfigMap for {}", rolegroup))]
150159
ApplyRoleGroupConfig {
151-
source: stackable_operator::error::Error,
160+
source: stackable_operator::cluster_resources::Error,
152161
rolegroup: RoleGroupRef<NifiCluster>,
153162
},
154163

155164
#[snafu(display("failed to apply StatefulSet for {}", rolegroup))]
156165
ApplyRoleGroupStatefulSet {
157-
source: stackable_operator::error::Error,
166+
source: stackable_operator::cluster_resources::Error,
158167
rolegroup: RoleGroupRef<NifiCluster>,
159168
},
160169

161170
#[snafu(display("failed to apply create ReportingTask service"))]
162171
ApplyCreateReportingTaskService {
163-
source: stackable_operator::error::Error,
172+
source: stackable_operator::cluster_resources::Error,
164173
},
165174

166175
#[snafu(display("failed to apply create ReportingTask job"))]
167176
ApplyCreateReportingTaskJob {
168-
source: stackable_operator::error::Error,
177+
source: stackable_operator::cluster_resources::Error,
169178
},
170179

171180
#[snafu(display("object is missing metadata to build owner reference"))]
172181
ObjectMissingMetadataForOwnerRef {
173-
source: stackable_operator::error::Error,
182+
source: stackable_operator::builder::meta::Error,
174183
},
175184

176-
#[snafu(display("Failed to load Product Config"))]
177-
ProductConfigLoadFailed { source: config::Error },
185+
#[snafu(display("Failed to load product config"))]
186+
ProductConfigLoadFailed {
187+
#[snafu(source(from(config::Error, Box::new)))]
188+
source: Box<config::Error>,
189+
},
178190

179191
#[snafu(display("Failed to find information about file [{}] in product config", kind))]
180192
ProductConfigKindNotSpecified { kind: String },
181193

182194
#[snafu(display("Failed to find any nodes in cluster {obj_ref}",))]
183195
MissingNodes {
184-
source: stackable_operator::error::Error,
196+
source: stackable_operator::client::Error,
185197
obj_ref: ObjectRef<NifiCluster>,
186198
},
187199

188200
#[snafu(display("Failed to find service {obj_ref}"))]
189201
MissingService {
190-
source: stackable_operator::error::Error,
202+
source: stackable_operator::client::Error,
191203
obj_ref: ObjectRef<Service>,
192204
},
193205

@@ -198,17 +210,21 @@ pub enum Error {
198210
NoRoleServiceFqdn,
199211

200212
#[snafu(display("Bootstrap configuration error"))]
201-
BoostrapConfig { source: crate::config::Error },
213+
BootstrapConfig {
214+
#[snafu(source(from(config::Error, Box::new)))]
215+
source: Box<config::Error>,
216+
},
202217

203218
#[snafu(display("failed to prepare NiFi configuration for rolegroup {rolegroup}"))]
204219
BuildProductConfig {
205-
source: crate::config::Error,
220+
#[snafu(source(from(config::Error, Box::new)))]
221+
source: Box<config::Error>,
206222
rolegroup: RoleGroupRef<NifiCluster>,
207223
},
208224

209225
#[snafu(display("illegal container name: [{container_name}]"))]
210226
IllegalContainerName {
211-
source: stackable_operator::error::Error,
227+
source: stackable_operator::builder::pod::container::Error,
212228
container_name: String,
213229
},
214230

@@ -234,17 +250,17 @@ pub enum Error {
234250

235251
#[snafu(display("failed to patch service account"))]
236252
ApplyServiceAccount {
237-
source: stackable_operator::error::Error,
253+
source: stackable_operator::cluster_resources::Error,
238254
},
239255

240256
#[snafu(display("failed to patch role binding"))]
241257
ApplyRoleBinding {
242-
source: stackable_operator::error::Error,
258+
source: stackable_operator::cluster_resources::Error,
243259
},
244260

245261
#[snafu(display("failed to build RBAC resources"))]
246262
BuildRbacResources {
247-
source: stackable_operator::error::Error,
263+
source: stackable_operator::commons::rbac::Error,
248264
},
249265

250266
#[snafu(display(
@@ -278,7 +294,7 @@ pub enum Error {
278294

279295
#[snafu(display("failed to build metadata"))]
280296
MetadataBuild {
281-
source: stackable_operator::builder::ObjectMetaBuilderError,
297+
source: stackable_operator::builder::meta::Error,
282298
},
283299

284300
#[snafu(display("failed to get required labels"))]
@@ -333,7 +349,7 @@ pub async fn reconcile_nifi(nifi: Arc<NifiCluster>, ctx: Arc<Ctx>) -> Result<Act
333349
let resolved_product_image: ResolvedProductImage = nifi
334350
.spec
335351
.image
336-
.resolve(DOCKER_IMAGE_BASE_NAME, crate::built_info::CARGO_PKG_VERSION);
352+
.resolve(DOCKER_IMAGE_BASE_NAME, crate::built_info::PKG_VERSION);
337353

338354
tracing::info!("Checking for sensitive key configuration");
339355
check_or_generate_sensitive_key(client, &nifi)
@@ -361,7 +377,7 @@ pub async fn reconcile_nifi(nifi: Arc<NifiCluster>, ctx: Arc<Ctx>) -> Result<Act
361377
let deployed_statefulsets = client
362378
.list_with_label_selector::<StatefulSet>(namespace, &selector)
363379
.await
364-
.context(ApplyRoleServiceSnafu)?;
380+
.context(FetchStatefulsetsSnafu)?;
365381

366382
// Sum target replicas for all statefulsets
367383
let target_replicas = deployed_statefulsets
@@ -722,7 +738,7 @@ async fn build_node_rolegroup_config_map(
722738
})?
723739
.clone(),
724740
)
725-
.context(BoostrapConfigSnafu)?,
741+
.context(BootstrapConfigSnafu)?,
726742
)
727743
.add_data(
728744
NIFI_PROPERTIES,

0 commit comments

Comments
 (0)