Skip to content

Commit 5153e66

Browse files
chore: Update templated files (9001281) (#585)
* 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 9bd4cb8 commit 5153e66

File tree

9 files changed

+54
-38
lines changed

9 files changed

+54
-38
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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ fn get_affinity_for_role(cluster_name: &str, role: &str) -> StackableAffinityFra
4141
#[cfg(test)]
4242
mod tests {
4343

44-
use rstest::rstest;
4544
use std::collections::BTreeMap;
4645

46+
use rstest::rstest;
4747
use stackable_operator::{
4848
commons::affinity::StackableAffinity,
4949
k8s_openapi::{

rust/crd/src/authentication.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::{future::Future, mem};
1+
use std::{collections::BTreeSet, future::Future, mem};
22

33
use serde::{Deserialize, Serialize};
44
use snafu::{ensure, ResultExt, Snafu};
@@ -11,7 +11,6 @@ use stackable_operator::{
1111
},
1212
schemars::{self, JsonSchema},
1313
};
14-
use std::collections::BTreeSet;
1514
use tracing::info;
1615

1716
const SUPPORTED_AUTHENTICATION_CLASS_PROVIDERS: [&str; 2] = ["LDAP", "OIDC"];
@@ -319,11 +318,16 @@ mod tests {
319318
use std::pin::Pin;
320319

321320
use indoc::indoc;
322-
use stackable_operator::commons::networking::HostName;
323-
use stackable_operator::commons::tls_verification::{
324-
CaCert, Tls, TlsClientDetails, TlsServerVerification, TlsVerification,
321+
use stackable_operator::{
322+
commons::{
323+
authentication::oidc,
324+
networking::HostName,
325+
tls_verification::{
326+
CaCert, Tls, TlsClientDetails, TlsServerVerification, TlsVerification,
327+
},
328+
},
329+
kube,
325330
};
326-
use stackable_operator::{commons::authentication::oidc, kube};
327331

328332
use super::*;
329333

rust/crd/src/git_sync.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
use std::collections::BTreeMap;
2+
13
use serde::{Deserialize, Serialize};
24
use stackable_operator::{
35
schemars::{self, JsonSchema},
46
utils::COMMON_BASH_TRAP_FUNCTIONS,
57
};
6-
use std::collections::BTreeMap;
78

89
use crate::{GIT_LINK, GIT_ROOT, GIT_SAFE_DIR, GIT_SYNC_DEPTH, GIT_SYNC_PERIOD_SECONDS};
910

@@ -96,9 +97,10 @@ impl GitSync {
9697

9798
#[cfg(test)]
9899
mod tests {
99-
use crate::AirflowCluster;
100100
use rstest::rstest;
101101

102+
use crate::AirflowCluster;
103+
102104
#[test]
103105
fn test_git_sync() {
104106
let cluster = "

rust/crd/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -824,9 +824,10 @@ pub fn build_recommended_labels<'a, T>(
824824

825825
#[cfg(test)]
826826
mod tests {
827-
use crate::AirflowCluster;
828827
use stackable_operator::commons::product_image_selection::ResolvedProductImage;
829828

829+
use crate::AirflowCluster;
830+
830831
#[test]
831832
fn test_cluster_config() {
832833
let cluster = "

rust/operator-binary/src/airflow_controller.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ use product_config::{
1414
};
1515
use snafu::{OptionExt, ResultExt, Snafu};
1616
use stackable_airflow_crd::{
17-
authentication::AirflowAuthenticationClassResolved, git_sync::GitSync,
18-
};
19-
use stackable_airflow_crd::{
20-
authentication::AirflowClientAuthenticationDetailsResolved, build_recommended_labels,
17+
authentication::{
18+
AirflowAuthenticationClassResolved, AirflowClientAuthenticationDetailsResolved,
19+
},
20+
build_recommended_labels,
21+
git_sync::GitSync,
2122
AirflowCluster, AirflowClusterStatus, AirflowConfig, AirflowConfigOptions, AirflowExecutor,
2223
AirflowRole, Container, ExecutorConfig, ExecutorConfigFragment, AIRFLOW_CONFIG_FILENAME,
2324
AIRFLOW_UID, APP_NAME, CONFIG_PATH, GIT_CONTENT, GIT_ROOT, GIT_SYNC_NAME, LOG_CONFIG_DIR,
@@ -80,7 +81,6 @@ use stackable_operator::{
8081
time::Duration,
8182
utils::COMMON_BASH_TRAP_FUNCTIONS,
8283
};
83-
8484
use strum::{EnumDiscriminants, IntoEnumIterator, IntoStaticStr};
8585

8686
use crate::{

rust/operator-binary/src/config.rs

Lines changed: 10 additions & 5 deletions
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_airflow_crd::{
@@ -7,9 +9,10 @@ use stackable_airflow_crd::{
79
},
810
AirflowConfigOptions,
911
};
10-
use stackable_operator::commons::authentication::{ldap::AuthenticationProvider, oidc};
11-
use stackable_operator::commons::tls_verification::TlsVerification;
12-
use std::collections::BTreeMap;
12+
use stackable_operator::commons::{
13+
authentication::{ldap::AuthenticationProvider, oidc},
14+
tls_verification::TlsVerification,
15+
};
1316

1417
pub const PYTHON_IMPORTS: &[&str] = &[
1518
"import os",
@@ -273,15 +276,17 @@ fn append_oidc_config(
273276

274277
#[cfg(test)]
275278
mod tests {
276-
use crate::config::add_airflow_config;
279+
use std::collections::BTreeMap;
280+
277281
use indoc::formatdoc;
278282
use rstest::rstest;
279283
use stackable_airflow_crd::authentication::{
280284
default_sync_roles_at, default_user_registration, AirflowAuthenticationClassResolved,
281285
AirflowClientAuthenticationDetailsResolved, FlaskRolesSyncMoment,
282286
};
283287
use stackable_operator::commons::authentication::{ldap, oidc};
284-
use std::collections::BTreeMap;
288+
289+
use crate::config::add_airflow_config;
285290

286291
#[test]
287292
fn test_auth_db_config() {

rust/operator-binary/src/env_vars.rs

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
1-
use crate::util::env_var_from_secret;
1+
use std::collections::{BTreeMap, BTreeSet, HashMap};
2+
23
use product_config::types::PropertyNameKind;
3-
use stackable_airflow_crd::authentication::{
4-
AirflowAuthenticationClassResolved, AirflowClientAuthenticationDetailsResolved,
5-
};
6-
use stackable_airflow_crd::git_sync::GitSync;
74
use stackable_airflow_crd::{
8-
AirflowCluster, AirflowConfig, AirflowExecutor, AirflowRole, ExecutorConfig, LOG_CONFIG_DIR,
9-
STACKABLE_LOG_DIR,
5+
authentication::{
6+
AirflowAuthenticationClassResolved, AirflowClientAuthenticationDetailsResolved,
7+
},
8+
git_sync::GitSync,
9+
AirflowCluster, AirflowConfig, AirflowExecutor, AirflowRole, ExecutorConfig, GIT_LINK,
10+
GIT_SYNC_DIR, LOG_CONFIG_DIR, STACKABLE_LOG_DIR, TEMPLATE_LOCATION, TEMPLATE_NAME,
1011
};
11-
use stackable_airflow_crd::{GIT_LINK, GIT_SYNC_DIR, TEMPLATE_LOCATION, TEMPLATE_NAME};
12-
use stackable_operator::commons::authentication::oidc;
13-
use stackable_operator::k8s_openapi::api::core::v1::EnvVar;
14-
use stackable_operator::kube::ResourceExt;
15-
use stackable_operator::product_logging::framework::create_vector_shutdown_file_command;
16-
use std::collections::{BTreeMap, BTreeSet, HashMap};
12+
use stackable_operator::{
13+
commons::authentication::oidc, k8s_openapi::api::core::v1::EnvVar, kube::ResourceExt,
14+
product_logging::framework::create_vector_shutdown_file_command,
15+
};
16+
17+
use crate::util::env_var_from_secret;
1718

1819
const AIRFLOW__LOGGING__LOGGING_CONFIG_CLASS: &str = "AIRFLOW__LOGGING__LOGGING_CONFIG_CLASS";
1920
const AIRFLOW__METRICS__STATSD_ON: &str = "AIRFLOW__METRICS__STATSD_ON";

0 commit comments

Comments
 (0)