Skip to content
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
8 changes: 4 additions & 4 deletions .github/PULL_REQUEST_TEMPLATE/pre-release-rust-deps.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Bump Rust Dependencies for Stackable Release XX.(X)X
# Bump Rust Dependencies for Stackable Release YY.M.X

<!--
Make sure to update the link in 'issues/.github/ISSUE_TEMPLATE/pre-release-operator-rust-deps.md'
Expand Down Expand Up @@ -32,7 +32,7 @@ Part of <https://github.com/stackabletech/issues/issues/TRACKING_ISSUE>
```[tasklist]
### Bump Rust Dependencies
- [ ] Bump `stackable-operator` and friends.
- [ ] Bump `product-version`.
- [ ] Bump all other dependencies.
- [ ] Bump `stackable-operator` and friends
- [ ] Bump `product-config`
- [ ] Bump all other dependencies
```
9 changes: 6 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: '0'
CARGO_PROFILE_DEV_DEBUG: '0'
RUST_TOOLCHAIN_VERSION: "1.84.1"
RUST_TOOLCHAIN_VERSION: "1.85.0"
RUST_NIGHTLY_TOOLCHAIN_VERSION: "nightly-2025-01-15"
PYTHON_VERSION: "3.12"
RUSTFLAGS: "-D warnings"
RUSTDOCFLAGS: "-D warnings"
Expand Down Expand Up @@ -136,9 +137,11 @@ jobs:
submodules: recursive
- uses: dtolnay/rust-toolchain@c5a29ddb4d9d194e7c84ec8c3fba61b1c31fee8c
with:
toolchain: ${{ env.RUST_TOOLCHAIN_VERSION }}
toolchain: ${{ env.RUST_NIGHTLY_TOOLCHAIN_VERSION }}
components: rustfmt
- run: cargo fmt --all -- --check
- env:
RUST_TOOLCHAIN_VERSION: ${{ env.RUST_NIGHTLY_TOOLCHAIN_VERSION }}
run: cargo "+$RUST_TOOLCHAIN_VERSION" fmt --all -- --check

run_clippy:
name: Run Clippy
Expand Down
7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"rust-analyzer.rustfmt.overrideCommand": [
"rustfmt",
"+nightly-2025-01-15",
"--"
],
}
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# DO NOT EDIT, this file is generated by operator-templating
[toolchain]
channel = "1.84.1"
channel = "1.85.0"
4 changes: 2 additions & 2 deletions rust/operator-binary/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
mod restart_controller;

use built_info::PKG_VERSION;
use clap::{crate_description, crate_version, Parser};
use clap::{Parser, crate_description, crate_version};
use futures::pin_mut;
use stackable_operator::{
CustomResourceExt,
cli::{Command, ProductOperatorRun},
commons::{
authentication::AuthenticationClass,
s3::{S3Bucket, S3Connection},
},
CustomResourceExt,
};

mod built_info {
Expand Down
16 changes: 7 additions & 9 deletions rust/operator-binary/src/restart_controller/pod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@ use stackable_operator::{
api::{EvictParams, PartialObjectMeta},
core::DynamicObject,
runtime::{
Controller,
controller::Action,
events::{Recorder, Reporter},
reflector::ObjectRef,
watcher, Controller,
watcher,
},
},
logging::controller::{report_controller_reconciled, ReconcilerError},
logging::controller::{ReconcilerError, report_controller_reconciled},
namespace::WatchNamespace,
};
use strum::{EnumDiscriminants, IntoStaticStr};
Expand Down Expand Up @@ -73,13 +74,10 @@ pub async fn start(client: &Client, watch_namespace: &WatchNamespace) {
watch_namespace.get_api::<PartialObjectMeta<Pod>>(client),
watcher::Config::default(),
);
let event_recorder = Arc::new(Recorder::new(
client.as_kube_client(),
Reporter {
controller: FULL_CONTROLLER_NAME.to_string(),
instance: None,
},
));
let event_recorder = Arc::new(Recorder::new(client.as_kube_client(), Reporter {
controller: FULL_CONTROLLER_NAME.to_string(),
instance: None,
}));
controller
.run(
reconcile,
Expand Down
27 changes: 12 additions & 15 deletions rust/operator-binary/src/restart_controller/statefulset.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use std::{
collections::BTreeMap,
sync::{atomic::AtomicBool, Arc},
sync::{Arc, atomic::AtomicBool},
time::Duration,
};

use futures::{stream, Stream, StreamExt, TryStream};
use futures::{Stream, StreamExt, TryStream, stream};
use serde_json::json;
use snafu::{ResultExt, Snafu};
use stackable_operator::{
Expand All @@ -15,19 +15,19 @@ use stackable_operator::{
},
kube,
kube::{
Resource, ResourceExt,
api::{PartialObjectMeta, Patch, PatchParams},
core::{error_boundary, DeserializeGuard, DynamicObject},
core::{DeserializeGuard, DynamicObject, error_boundary},
runtime::{
applier,
controller::{trigger_self, trigger_with, Action, ReconcileRequest},
Config, WatchStreamExt, applier,
controller::{Action, ReconcileRequest, trigger_self, trigger_with},
events::{Recorder, Reporter},
metadata_watcher, reflector,
reflector::{ObjectRef, Store},
watcher, Config, WatchStreamExt,
watcher,
},
Resource, ResourceExt,
},
logging::controller::{report_controller_reconciled, ReconcilerError},
logging::controller::{ReconcilerError, report_controller_reconciled},
namespace::WatchNamespace,
};
use strum::{EnumDiscriminants, IntoStaticStr};
Expand Down Expand Up @@ -87,13 +87,10 @@ pub async fn start(client: &Client, watch_namespace: &WatchNamespace) {
let secret_store = reflector::store::Writer::<PartialObjectMeta<Secret>>::new(());
let cms_inited = Arc::new(AtomicBool::from(false));
let secrets_inited = Arc::new(AtomicBool::from(false));
let event_recorder = Arc::new(Recorder::new(
client.as_kube_client(),
Reporter {
controller: FULL_CONTROLLER_NAME.to_string(),
instance: None,
},
));
let event_recorder = Arc::new(Recorder::new(client.as_kube_client(), Reporter {
controller: FULL_CONTROLLER_NAME.to_string(),
instance: None,
}));

applier(
|sts, ctx| Box::pin(reconcile(sts, ctx)),
Expand Down
6 changes: 5 additions & 1 deletion rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# This file includes unstable features, so you need to run "cargo +nightly fmt" to format your code.
# It's also ok to use the stable toolchain by simple running "cargo fmt", but using the nigthly formatter is prefered.

# https://doc.rust-lang.org/nightly/edition-guide/rust-2024/rustfmt-style-edition.html
style_edition = "2024"
imports_granularity = "Crate"
group_imports = "StdExternalCrate"
group_imports = "StdExternalCrate"
reorder_impl_items = true
use_field_init_shorthand = true