Skip to content

Commit ebbea85

Browse files
chore: Update templated files (9001281) (#751)
* chore: Generated commit to update templated files since the last template run up to stackabletech/operator-templating@9001281 Reference-to: stackabletech/operator-templating@9001281 (Fix pre-commit hook) * chore: Apply formatting --------- Co-authored-by: Techassi <[email protected]>
1 parent 1680ca8 commit ebbea85

File tree

10 files changed

+36
-33
lines changed

10 files changed

+36
-33
lines changed

.github/workflows/pr_pre-commit.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66

77
env:
88
CARGO_TERM_COLOR: always
9-
RUST_TOOLCHAIN_VERSION: "1.82.0"
9+
RUST_TOOLCHAIN_VERSION: "nightly-2025-01-15"
1010
HADOLINT_VERSION: "v2.12.0"
1111
PYTHON_VERSION: "3.12"
1212

.pre-commit-config.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ repos:
1717
- repo: https://github.com/doublify/pre-commit-rust
1818
rev: eeee35a89e69d5772bdee97db1a6a898467b686e # 1.0
1919
hooks:
20-
- id: fmt
21-
# Pinning to a specific rustc version, so that we get consistent formatting
22-
entry: RUSTUP_TOOLCHAIN=nightly-2025-01-15 cargo fmt
23-
args: ["--all", "--", "--check"]
2420
- id: clippy
2521
args: ["--all-targets", "--", "-D", "warnings"]
2622

@@ -78,3 +74,10 @@ repos:
7874
entry: cargo test
7975
stages: [pre-commit, pre-merge-commit, manual]
8076
pass_filenames: false
77+
78+
- id: cargo-rustfmt
79+
name: cargo-rustfmt
80+
language: system
81+
entry: cargo +nightly-2025-01-15 fmt --all -- --check
82+
stages: [pre-commit]
83+
pass_filenames: false

rust/crd/src/affinity.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,8 @@ pub fn get_affinity(cluster_name: &str, role: &NifiRole) -> StackableAffinityFra
2121

2222
#[cfg(test)]
2323
mod tests {
24-
use super::*;
25-
2624
use std::collections::BTreeMap;
2725

28-
use crate::NifiCluster;
2926
use stackable_operator::{
3027
commons::affinity::StackableAffinity,
3128
k8s_openapi::{
@@ -34,6 +31,9 @@ mod tests {
3431
},
3532
};
3633

34+
use super::*;
35+
use crate::NifiCluster;
36+
3737
#[test]
3838
fn test_affinity_defaults() {
3939
let input = r#"

rust/crd/src/authentication.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
use std::future::Future;
22

33
use snafu::{ResultExt, Snafu};
4-
use stackable_operator::commons::authentication::{
5-
ldap, oidc, static_, AuthenticationClassProvider, ClientAuthenticationDetails,
6-
};
7-
use stackable_operator::kube::ResourceExt;
84
use stackable_operator::{
9-
client::Client, commons::authentication::AuthenticationClass,
10-
kube::runtime::reflector::ObjectRef,
5+
client::Client,
6+
commons::authentication::{
7+
ldap, oidc, static_, AuthenticationClass, AuthenticationClassProvider,
8+
ClientAuthenticationDetails,
9+
},
10+
kube::{runtime::reflector::ObjectRef, ResourceExt},
1111
};
1212

1313
use crate::NifiCluster;

rust/operator-binary/src/config/mod.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -666,13 +666,12 @@ fn storage_quantity_to_nifi(quantity: MemoryQuantity) -> String {
666666

667667
#[cfg(test)]
668668
mod tests {
669-
use crate::config::build_bootstrap_conf;
670-
671-
use super::*;
672-
673669
use indoc::indoc;
674670
use stackable_nifi_crd::NifiCluster;
675671

672+
use super::*;
673+
use crate::config::build_bootstrap_conf;
674+
676675
#[test]
677676
fn test_build_bootstrap_conf_defaults() {
678677
let input = r#"

rust/operator-binary/src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@ mod product_logging;
55
mod reporting_task;
66
mod security;
77

8+
use std::sync::Arc;
9+
810
use clap::{crate_description, crate_version, Parser};
911
use futures::stream::StreamExt;
12+
use stackable_nifi_crd::NifiCluster;
1013
use stackable_operator::{
1114
cli::{Command, ProductOperatorRun},
1215
commons::authentication::AuthenticationClass,
@@ -25,9 +28,6 @@ use stackable_operator::{
2528
logging::controller::report_controller_reconciled,
2629
CustomResourceExt,
2730
};
28-
use std::sync::Arc;
29-
30-
use stackable_nifi_crd::NifiCluster;
3131

3232
use crate::controller::NIFI_FULL_CONTROLLER_NAME;
3333

rust/operator-binary/src/reporting_task/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,10 @@
2424
//!
2525
use std::collections::BTreeMap;
2626

27-
use crate::security::{
28-
authentication::{NifiAuthenticationConfig, STACKABLE_ADMIN_USERNAME},
29-
build_tls_volume,
30-
};
3127
use snafu::{OptionExt, ResultExt, Snafu};
3228
use stackable_nifi_crd::{
3329
NifiCluster, NifiRole, APP_NAME, HTTPS_PORT, HTTPS_PORT_NAME, METRICS_PORT,
3430
};
35-
use stackable_operator::time::Duration;
3631
use stackable_operator::{
3732
builder::{
3833
self,
@@ -52,10 +47,15 @@ use stackable_operator::{
5247
},
5348
kube::ResourceExt,
5449
kvp::Labels,
50+
time::Duration,
5551
utils::cluster_info::KubernetesClusterInfo,
5652
};
5753

5854
use super::controller::{build_recommended_labels, NIFI_UID};
55+
use crate::security::{
56+
authentication::{NifiAuthenticationConfig, STACKABLE_ADMIN_USERNAME},
57+
build_tls_volume,
58+
};
5959

6060
const REPORTING_TASK_CERT_VOLUME_NAME: &str = "tls";
6161
const REPORTING_TASK_CERT_VOLUME_MOUNT: &str = "/stackable/cert";

rust/operator-binary/src/security/authentication.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use indoc::{formatdoc, indoc};
22
use snafu::{OptionExt, ResultExt, Snafu};
3-
use stackable_nifi_crd::authentication::AuthenticationClassResolved;
4-
use stackable_nifi_crd::NifiCluster;
3+
use stackable_nifi_crd::{authentication::AuthenticationClassResolved, NifiCluster};
54
use stackable_operator::{
65
builder::{
76
self,

rust/operator-binary/src/security/mod.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
use snafu::{ResultExt, Snafu};
22
use stackable_nifi_crd::NifiCluster;
3-
use stackable_operator::client::Client;
4-
use stackable_operator::time::Duration;
5-
use stackable_operator::{builder::pod::volume::SecretFormat, k8s_openapi::api::core::v1::Volume};
3+
use stackable_operator::{
4+
builder::pod::volume::SecretFormat, client::Client, k8s_openapi::api::core::v1::Volume,
5+
time::Duration,
6+
};
67

78
pub mod authentication;
89
pub mod oidc;

rust/operator-binary/src/security/tls.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
use crate::security::authentication::STACKABLE_TLS_STORE_PASSWORD;
21
use snafu::{ResultExt, Snafu};
32
use stackable_nifi_crd::NifiCluster;
4-
use stackable_operator::time::Duration;
53
use stackable_operator::{
64
builder::pod::volume::{SecretFormat, SecretOperatorVolumeSourceBuilder, VolumeBuilder},
75
k8s_openapi::api::core::v1::Volume,
6+
time::Duration,
87
};
98

9+
use crate::security::authentication::STACKABLE_TLS_STORE_PASSWORD;
10+
1011
pub const KEYSTORE_VOLUME_NAME: &str = "keystore";
1112
pub const KEYSTORE_NIFI_CONTAINER_MOUNT: &str = "/stackable/keystore";
1213
pub const TRUSTSTORE_VOLUME_NAME: &str = "truststore";

0 commit comments

Comments
 (0)