Skip to content

Commit f584811

Browse files
chore: Update templated files (9001281) (#570)
* 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 <git@techassi.dev>
1 parent 4470a2a commit f584811

File tree

7 files changed

+25
-25
lines changed

7 files changed

+25
-25
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: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,9 @@ pub fn get_affinity(cluster_name: &str, role: &HiveRole) -> StackableAffinityFra
2121

2222
#[cfg(test)]
2323
mod tests {
24-
use super::*;
25-
26-
use rstest::rstest;
2724
use std::collections::BTreeMap;
2825

29-
use crate::HiveCluster;
26+
use rstest::rstest;
3027
use stackable_operator::{
3128
commons::affinity::StackableAffinity,
3229
k8s_openapi::{
@@ -35,6 +32,9 @@ mod tests {
3532
},
3633
};
3734

35+
use super::*;
36+
use crate::HiveCluster;
37+
3838
#[rstest]
3939
#[case(HiveRole::MetaStore)]
4040
fn test_affinity_defaults(#[case] role: HiveRole) {

rust/operator-binary/src/controller.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,16 @@ use stackable_operator::{
3737
commons::{
3838
product_image_selection::ResolvedProductImage,
3939
rbac::build_rbac_resources,
40-
s3::{S3AccessStyle, S3ConnectionSpec},
40+
s3::{S3AccessStyle, S3ConnectionSpec, S3Error},
4141
tls_verification::TlsClientDetailsError,
4242
},
4343
k8s_openapi::{
4444
api::{
4545
apps::v1::{StatefulSet, StatefulSetSpec},
4646
core::v1::{
47-
ConfigMap, ConfigMapVolumeSource, EmptyDirVolumeSource, Probe, Service,
48-
ServicePort, ServiceSpec, TCPSocketAction, Volume,
47+
ConfigMap, ConfigMapVolumeSource, EmptyDirVolumeSource, EnvVar, EnvVarSource,
48+
Probe, SecretKeySelector, Service, ServicePort, ServiceSpec, TCPSocketAction,
49+
Volume,
4950
},
5051
},
5152
apimachinery::pkg::{
@@ -80,10 +81,6 @@ use stackable_operator::{
8081
time::Duration,
8182
utils::{cluster_info::KubernetesClusterInfo, COMMON_BASH_TRAP_FUNCTIONS},
8283
};
83-
use stackable_operator::{
84-
commons::s3::S3Error,
85-
k8s_openapi::api::core::v1::{EnvVar, EnvVarSource, SecretKeySelector},
86-
};
8784
use strum::EnumDiscriminants;
8885
use tracing::warn;
8986

rust/operator-binary/src/discovery.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
use crate::controller::build_recommended_labels;
1+
use std::{collections::BTreeSet, num::TryFromIntError};
22

33
use snafu::{OptionExt, ResultExt, Snafu};
44
use stackable_hive_crd::{HiveCluster, HiveRole, ServiceType, HIVE_PORT, HIVE_PORT_NAME};
5-
use stackable_operator::commons::product_image_selection::ResolvedProductImage;
65
use stackable_operator::{
76
builder::{configmap::ConfigMapBuilder, meta::ObjectMetaBuilder},
8-
k8s_openapi::api::core::v1::ConfigMap,
9-
k8s_openapi::api::core::v1::{Endpoints, Service, ServiceSpec},
7+
commons::product_image_selection::ResolvedProductImage,
8+
k8s_openapi::api::core::v1::{ConfigMap, Endpoints, Service, ServiceSpec},
109
kube::{runtime::reflector::ObjectRef, Resource},
1110
};
12-
use std::collections::BTreeSet;
13-
use std::num::TryFromIntError;
11+
12+
use crate::controller::build_recommended_labels;
1413

1514
#[derive(Snafu, Debug)]
1615
pub enum Error {

rust/operator-binary/src/kerberos.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
use std::collections::BTreeMap;
2+
13
use indoc::formatdoc;
24
use snafu::{ResultExt, Snafu};
35
use stackable_hive_crd::{HiveCluster, HiveRole, HIVE_SITE_XML, STACKABLE_CONFIG_DIR};
@@ -16,7 +18,6 @@ use stackable_operator::{
1618
kube::ResourceExt,
1719
utils::cluster_info::KubernetesClusterInfo,
1820
};
19-
use std::collections::BTreeMap;
2021

2122
#[derive(Snafu, Debug)]
2223
#[allow(clippy::enum_variant_names)] // all variants have the same prefix: `Add`

rust/operator-binary/src/product_logging.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
use crate::controller::MAX_HIVE_LOG_FILES_SIZE;
2-
31
use snafu::{OptionExt, ResultExt, Snafu};
42
use stackable_hive_crd::{
53
Container, HiveCluster, HIVE_METASTORE_LOG4J2_PROPERTIES, STACKABLE_LOG_DIR,
@@ -17,6 +15,8 @@ use stackable_operator::{
1715
role_utils::RoleGroupRef,
1816
};
1917

18+
use crate::controller::MAX_HIVE_LOG_FILES_SIZE;
19+
2020
#[derive(Snafu, Debug)]
2121
pub enum Error {
2222
#[snafu(display("object has no namespace"))]

0 commit comments

Comments
 (0)