Skip to content

chore: Update templated files (9001281) #570

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pr_pre-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

env:
CARGO_TERM_COLOR: always
RUST_TOOLCHAIN_VERSION: "1.82.0"
RUST_TOOLCHAIN_VERSION: "nightly-2025-01-15"
HADOLINT_VERSION: "v2.12.0"
PYTHON_VERSION: "3.12"

Expand Down
11 changes: 7 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ repos:
- repo: https://github.com/doublify/pre-commit-rust
rev: eeee35a89e69d5772bdee97db1a6a898467b686e # 1.0
hooks:
- id: fmt
# Pinning to a specific rustc version, so that we get consistent formatting
entry: RUSTUP_TOOLCHAIN=nightly-2025-01-15 cargo fmt
args: ["--all", "--", "--check"]
- id: clippy
args: ["--all-targets", "--", "-D", "warnings"]

Expand Down Expand Up @@ -78,3 +74,10 @@ repos:
entry: cargo test
stages: [pre-commit, pre-merge-commit, manual]
pass_filenames: false

- id: cargo-rustfmt
name: cargo-rustfmt
language: system
entry: cargo +nightly-2025-01-15 fmt --all -- --check
stages: [pre-commit]
pass_filenames: false
8 changes: 4 additions & 4 deletions rust/crd/src/affinity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,9 @@ pub fn get_affinity(cluster_name: &str, role: &HiveRole) -> StackableAffinityFra

#[cfg(test)]
mod tests {
use super::*;

use rstest::rstest;
use std::collections::BTreeMap;

use crate::HiveCluster;
use rstest::rstest;
use stackable_operator::{
commons::affinity::StackableAffinity,
k8s_openapi::{
Expand All @@ -35,6 +32,9 @@ mod tests {
},
};

use super::*;
use crate::HiveCluster;

#[rstest]
#[case(HiveRole::MetaStore)]
fn test_affinity_defaults(#[case] role: HiveRole) {
Expand Down
11 changes: 4 additions & 7 deletions rust/operator-binary/src/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,16 @@ use stackable_operator::{
commons::{
product_image_selection::ResolvedProductImage,
rbac::build_rbac_resources,
s3::{S3AccessStyle, S3ConnectionSpec},
s3::{S3AccessStyle, S3ConnectionSpec, S3Error},
tls_verification::TlsClientDetailsError,
},
k8s_openapi::{
api::{
apps::v1::{StatefulSet, StatefulSetSpec},
core::v1::{
ConfigMap, ConfigMapVolumeSource, EmptyDirVolumeSource, Probe, Service,
ServicePort, ServiceSpec, TCPSocketAction, Volume,
ConfigMap, ConfigMapVolumeSource, EmptyDirVolumeSource, EnvVar, EnvVarSource,
Probe, SecretKeySelector, Service, ServicePort, ServiceSpec, TCPSocketAction,
Volume,
},
},
apimachinery::pkg::{
Expand Down Expand Up @@ -80,10 +81,6 @@ use stackable_operator::{
time::Duration,
utils::{cluster_info::KubernetesClusterInfo, COMMON_BASH_TRAP_FUNCTIONS},
};
use stackable_operator::{
commons::s3::S3Error,
k8s_openapi::api::core::v1::{EnvVar, EnvVarSource, SecretKeySelector},
};
use strum::EnumDiscriminants;
use tracing::warn;

Expand Down
11 changes: 5 additions & 6 deletions rust/operator-binary/src/discovery.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
use crate::controller::build_recommended_labels;
use std::{collections::BTreeSet, num::TryFromIntError};

use snafu::{OptionExt, ResultExt, Snafu};
use stackable_hive_crd::{HiveCluster, HiveRole, ServiceType, HIVE_PORT, HIVE_PORT_NAME};
use stackable_operator::commons::product_image_selection::ResolvedProductImage;
use stackable_operator::{
builder::{configmap::ConfigMapBuilder, meta::ObjectMetaBuilder},
k8s_openapi::api::core::v1::ConfigMap,
k8s_openapi::api::core::v1::{Endpoints, Service, ServiceSpec},
commons::product_image_selection::ResolvedProductImage,
k8s_openapi::api::core::v1::{ConfigMap, Endpoints, Service, ServiceSpec},
kube::{runtime::reflector::ObjectRef, Resource},
};
use std::collections::BTreeSet;
use std::num::TryFromIntError;

use crate::controller::build_recommended_labels;

#[derive(Snafu, Debug)]
pub enum Error {
Expand Down
3 changes: 2 additions & 1 deletion rust/operator-binary/src/kerberos.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use std::collections::BTreeMap;

use indoc::formatdoc;
use snafu::{ResultExt, Snafu};
use stackable_hive_crd::{HiveCluster, HiveRole, HIVE_SITE_XML, STACKABLE_CONFIG_DIR};
Expand All @@ -16,7 +18,6 @@ use stackable_operator::{
kube::ResourceExt,
utils::cluster_info::KubernetesClusterInfo,
};
use std::collections::BTreeMap;

#[derive(Snafu, Debug)]
#[allow(clippy::enum_variant_names)] // all variants have the same prefix: `Add`
Expand Down
4 changes: 2 additions & 2 deletions rust/operator-binary/src/product_logging.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use crate::controller::MAX_HIVE_LOG_FILES_SIZE;

use snafu::{OptionExt, ResultExt, Snafu};
use stackable_hive_crd::{
Container, HiveCluster, HIVE_METASTORE_LOG4J2_PROPERTIES, STACKABLE_LOG_DIR,
Expand All @@ -17,6 +15,8 @@ use stackable_operator::{
role_utils::RoleGroupRef,
};

use crate::controller::MAX_HIVE_LOG_FILES_SIZE;

#[derive(Snafu, Debug)]
pub enum Error {
#[snafu(display("object has no namespace"))]
Expand Down