Skip to content

Commit 2fcecd1

Browse files
chore: Update templated files (9001281) (#623)
* 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 f05bdb6 commit 2fcecd1

File tree

9 files changed

+37
-33
lines changed

9 files changed

+37
-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: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,9 @@ pub fn get_affinity(
7777

7878
#[cfg(test)]
7979
mod tests {
80-
use super::*;
81-
82-
use rstest::rstest;
8380
use std::collections::BTreeMap;
8481

85-
use crate::HbaseCluster;
82+
use rstest::rstest;
8683
use stackable_operator::{
8784
commons::affinity::StackableAffinity,
8885
k8s_openapi::{
@@ -93,6 +90,9 @@ mod tests {
9390
},
9491
};
9592

93+
use super::*;
94+
use crate::HbaseCluster;
95+
9696
#[rstest]
9797
#[case(HbaseRole::Master)]
9898
#[case(HbaseRole::RegionServer)]

rust/crd/src/lib.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ use stackable_operator::{
2828
};
2929
use strum::{Display, EnumIter, EnumString};
3030

31-
use crate::affinity::get_affinity;
32-
use crate::security::AuthorizationConfig;
31+
use crate::{affinity::get_affinity, security::AuthorizationConfig};
3332

3433
pub mod affinity;
3534
pub mod security;
@@ -704,14 +703,13 @@ mod tests {
704703
use std::collections::{BTreeMap, HashMap};
705704

706705
use indoc::indoc;
706+
use product_config::{types::PropertyNameKind, ProductConfigManager};
707707
use stackable_operator::product_config_utils::{
708708
transform_all_roles_to_config, validate_all_roles_and_groups_config,
709709
};
710710

711711
use crate::{merged_env, HbaseCluster, HbaseRole};
712712

713-
use product_config::{types::PropertyNameKind, ProductConfigManager};
714-
715713
#[test]
716714
pub fn test_env_overrides() {
717715
let input = indoc! {r#"

rust/crd/src/security.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
use serde::{Deserialize, Serialize};
2-
use stackable_operator::commons::opa::OpaConfig;
3-
use stackable_operator::schemars::{self, JsonSchema};
2+
use stackable_operator::{
3+
commons::opa::OpaConfig,
4+
schemars::{self, JsonSchema},
5+
};
46

57
#[derive(Clone, Debug, Deserialize, Eq, Hash, JsonSchema, PartialEq, Serialize)]
68
#[serde(rename_all = "camelCase")]

rust/operator-binary/src/hbase_controller.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ use product_config::{
1414
ProductConfigManager,
1515
};
1616
use snafu::{OptionExt, ResultExt, Snafu};
17+
use stackable_hbase_crd::{
18+
merged_env, Container, HbaseCluster, HbaseClusterStatus, HbaseConfig, HbaseConfigFragment,
19+
HbaseRole, APP_NAME, CONFIG_DIR_NAME, HBASE_ENV_SH, HBASE_REST_PORT_NAME_HTTP,
20+
HBASE_REST_PORT_NAME_HTTPS, HBASE_SITE_XML, JVM_SECURITY_PROPERTIES_FILE, SSL_CLIENT_XML,
21+
SSL_SERVER_XML,
22+
};
1723
use stackable_operator::{
1824
builder::{
1925
self,
@@ -66,19 +72,11 @@ use stackable_operator::{
6672
};
6773
use strum::{EnumDiscriminants, IntoStaticStr, ParseError};
6874

69-
use stackable_hbase_crd::{
70-
merged_env, Container, HbaseCluster, HbaseClusterStatus, HbaseConfig, HbaseConfigFragment,
71-
HbaseRole, APP_NAME, CONFIG_DIR_NAME, HBASE_ENV_SH, HBASE_REST_PORT_NAME_HTTP,
72-
HBASE_REST_PORT_NAME_HTTPS, HBASE_SITE_XML, JVM_SECURITY_PROPERTIES_FILE, SSL_CLIENT_XML,
73-
SSL_SERVER_XML,
74-
};
75-
76-
use crate::{config::jvm::construct_hbase_heapsize_env, product_logging::STACKABLE_LOG_DIR};
77-
use crate::{
78-
config::jvm::{construct_global_jvm_args, construct_role_specific_non_heap_jvm_args},
79-
security::opa::HbaseOpaConfig,
80-
};
8175
use crate::{
76+
config::jvm::{
77+
construct_global_jvm_args, construct_hbase_heapsize_env,
78+
construct_role_specific_non_heap_jvm_args,
79+
},
8280
discovery::build_discovery_configmap,
8381
kerberos::{
8482
self, add_kerberos_pod_config, kerberos_config_properties,
@@ -87,9 +85,11 @@ use crate::{
8785
},
8886
operations::{graceful_shutdown::add_graceful_shutdown_config, pdb::add_pdbs},
8987
product_logging::{
90-
extend_role_group_config_map, log4j_properties_file_name, resolve_vector_aggregator_address,
88+
extend_role_group_config_map, log4j_properties_file_name,
89+
resolve_vector_aggregator_address, STACKABLE_LOG_DIR,
9190
},
9291
security,
92+
security::opa::HbaseOpaConfig,
9393
zookeeper::{self, ZookeeperConnectionInformation},
9494
OPERATOR_NAME,
9595
};

rust/operator-binary/src/main.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
use std::sync::Arc;
2+
13
use clap::Parser;
24
use futures::StreamExt;
35
use hbase_controller::FULL_HBASE_CONTROLLER_NAME;
@@ -15,7 +17,6 @@ use stackable_operator::{
1517
logging::controller::report_controller_reconciled,
1618
CustomResourceExt,
1719
};
18-
use std::sync::Arc;
1920

2021
mod config;
2122
mod discovery;

rust/operator-binary/src/product_logging.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use snafu::{OptionExt, ResultExt, Snafu};
22
use stackable_hbase_crd::{Container, HbaseCluster};
3-
use stackable_operator::product_logging::spec::AutomaticContainerLogConfig;
43
use stackable_operator::{
54
builder::configmap::ConfigMapBuilder,
65
client::Client,
@@ -9,7 +8,9 @@ use stackable_operator::{
98
memory::BinaryMultiple,
109
product_logging::{
1110
self,
12-
spec::{ContainerLogConfig, ContainerLogConfigChoice, Logging},
11+
spec::{
12+
AutomaticContainerLogConfig, ContainerLogConfig, ContainerLogConfigChoice, Logging,
13+
},
1314
},
1415
role_utils::RoleGroupRef,
1516
};

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use snafu::{ResultExt, Snafu};
2-
use stackable_hbase_crd::security::AuthorizationConfig;
3-
use stackable_hbase_crd::HbaseCluster;
2+
use stackable_hbase_crd::{security::AuthorizationConfig, HbaseCluster};
43
use stackable_operator::{client::Client, commons::opa::OpaApiVersion};
54

65
const DEFAULT_DRY_RUN: bool = false;

0 commit comments

Comments
 (0)