Skip to content

Commit 25661d6

Browse files
chore: Update templated files (f1f1a9e) (#583)
* chore: Generated commit to update templated files since the last template run up to stackabletech/operator-templating@f1f1a9e Reference-to: stackabletech/operator-templating@f1f1a9e (Bump Rust to 1.85.0) * fix: rustfmt lint * ci: use nightly toolchain for cargo udeps * ci: use nightly toolchain for cargo udeps * Revert "ci: use nightly toolchain for cargo udeps" This reverts commit ddced68. * Revert "ci: use nightly toolchain for cargo udeps" This reverts commit 645d356. --------- Co-authored-by: Nick Larsen <[email protected]>
1 parent 53945ea commit 25661d6

File tree

35 files changed

+150
-147
lines changed

35 files changed

+150
-147
lines changed

.github/PULL_REQUEST_TEMPLATE/pre-release-rust-deps.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Bump Rust Dependencies for Stackable Release XX.(X)X
1+
# Bump Rust Dependencies for Stackable Release YY.M.X
22

33
<!--
44
Make sure to update the link in 'issues/.github/ISSUE_TEMPLATE/pre-release-operator-rust-deps.md'
@@ -32,7 +32,7 @@ Part of <https://github.com/stackabletech/issues/issues/TRACKING_ISSUE>
3232
3333
```[tasklist]
3434
### Bump Rust Dependencies
35-
- [ ] Bump `stackable-operator` and friends.
36-
- [ ] Bump `product-version`.
37-
- [ ] Bump all other dependencies.
35+
- [ ] Bump `stackable-operator` and friends
36+
- [ ] Bump `product-config`
37+
- [ ] Bump all other dependencies
3838
```

.github/workflows/build.yml

+6-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ env:
2626
CARGO_TERM_COLOR: always
2727
CARGO_INCREMENTAL: '0'
2828
CARGO_PROFILE_DEV_DEBUG: '0'
29-
RUST_TOOLCHAIN_VERSION: "1.84.1"
29+
RUST_TOOLCHAIN_VERSION: "1.85.0"
30+
RUST_NIGHTLY_TOOLCHAIN_VERSION: "nightly-2025-01-15"
3031
PYTHON_VERSION: "3.12"
3132
RUSTFLAGS: "-D warnings"
3233
RUSTDOCFLAGS: "-D warnings"
@@ -136,9 +137,11 @@ jobs:
136137
submodules: recursive
137138
- uses: dtolnay/rust-toolchain@c5a29ddb4d9d194e7c84ec8c3fba61b1c31fee8c
138139
with:
139-
toolchain: ${{ env.RUST_TOOLCHAIN_VERSION }}
140+
toolchain: ${{ env.RUST_NIGHTLY_TOOLCHAIN_VERSION }}
140141
components: rustfmt
141-
- run: cargo fmt --all -- --check
142+
- env:
143+
RUST_TOOLCHAIN_VERSION: ${{ env.RUST_NIGHTLY_TOOLCHAIN_VERSION }}
144+
run: cargo "+$RUST_TOOLCHAIN_VERSION" fmt --all -- --check
142145

143146
run_clippy:
144147
name: Run Clippy

.vscode/settings.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"rust-analyzer.rustfmt.overrideCommand": [
3+
"rustfmt",
4+
"+nightly-2025-01-15",
5+
"--"
6+
],
7+
}

deny.toml

-9
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,6 @@ ignore = [
2929
#
3030
# TODO: Remove after https://github.com/kube-rs/kube/pull/1652 is merged
3131
"RUSTSEC-2024-0384",
32-
33-
# https://rustsec.org/advisories/RUSTSEC-2025-0012
34-
# "backoff" is unmainted.
35-
#
36-
# Upstream (kube) has switched to backon in 0.99.0, and an upgrade is scheduled on our end. In the meantime,
37-
# this is a very low-severity problem.
38-
#
39-
# TODO: Remove after upgrading to kube 0.99.
40-
"RUSTSEC-2025-0012",
4132
]
4233

4334
[bans]

rust-toolchain.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# DO NOT EDIT, this file is generated by operator-templating
22
[toolchain]
3-
channel = "1.84.1"
3+
channel = "1.85.0"

rust/krb5-provision-keytab/src/active_directory.rs

+4-7
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use std::{
77
use byteorder::{LittleEndian, WriteBytesExt};
88
use krb5::{Keyblock, Keytab, KrbContext, Principal, PrincipalUnparseOptions};
99
use ldap3::{Ldap, LdapConnAsync, LdapConnSettings, Scope, SearchEntry};
10-
use rand::{seq::IndexedRandom, CryptoRng};
10+
use rand::{CryptoRng, seq::IndexedRandom};
1111
use snafu::{OptionExt, ResultExt, Snafu};
1212
use stackable_krb5_provision_keytab::ActiveDirectorySamAccountNameRules;
1313
use stackable_operator::{
@@ -399,12 +399,9 @@ async fn get_user_kvno(
399399

400400
// Perform search with KVNO attribute
401401
let (search_results, _) = ldap
402-
.search(
403-
distinguished_name,
404-
Scope::Base,
405-
"(objectClass=user)",
406-
vec!["msDS-KeyVersionNumber"],
407-
)
402+
.search(distinguished_name, Scope::Base, "(objectClass=user)", vec![
403+
"msDS-KeyVersionNumber",
404+
])
408405
.await
409406
.context(SearchLdapSnafu)?
410407
.success()

rust/krb5-provision-keytab/src/credential_cache.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use futures::{TryFuture, TryFutureExt};
22
use snafu::{OptionExt, ResultExt, Snafu};
33
use stackable_operator::{
4-
k8s_openapi::{api::core::v1::Secret, ByteString},
4+
k8s_openapi::{ByteString, api::core::v1::Secret},
55
kube::{
66
self,
77
api::{Patch, PatchParams},

rust/krb5-provision-keytab/src/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::{
22
ffi::{CString, NulError},
33
fmt::Display,
4-
io::{stdin, BufReader},
4+
io::{BufReader, stdin},
55
};
66

77
use krb5::{Keyblock, Keytab};

rust/krb5-provision-keytab/src/mit.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::ffi::CStr;
22

3-
use krb5::{kadm5, Keytab, Principal};
3+
use krb5::{Keytab, Principal, kadm5};
44
use snafu::{ResultExt, Snafu};
55

66
#[derive(Debug, Snafu)]

rust/krb5/src/kadm5.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use std::{
2-
ffi::{c_char, c_int, CStr, CString},
2+
ffi::{CStr, CString, c_char, c_int},
33
fmt::Display,
44
slice,
55
};

rust/krb5/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//! The primary entry point is [`KrbContext`].
44
55
use std::{
6-
ffi::{c_char, c_int, CStr},
6+
ffi::{CStr, c_char, c_int},
77
fmt::{Debug, Display},
88
ops::Deref,
99
};

rust/krb5/src/profile.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use std::{
2-
ffi::{c_char, CStr, CString},
2+
ffi::{CStr, CString, c_char},
33
fmt::Display,
44
};
55

rust/olm-deployer/src/data.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use anyhow::{bail, Result};
2-
use stackable_operator::kube::{api::DynamicObject, ResourceExt};
1+
use anyhow::{Result, bail};
2+
use stackable_operator::kube::{ResourceExt, api::DynamicObject};
33

44
pub fn data_field_as_mut<'a>(
55
value: &'a mut serde_json::Value,

rust/olm-deployer/src/env/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use stackable_operator::{
22
k8s_openapi::api::{apps::v1::Deployment, core::v1::EnvVar},
33
kube::{
4-
api::{DynamicObject, GroupVersionKind},
54
ResourceExt,
5+
api::{DynamicObject, GroupVersionKind},
66
},
77
};
88

rust/olm-deployer/src/main.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ mod owner;
1818
mod resources;
1919
mod tolerations;
2020

21-
use anyhow::{anyhow, bail, Context, Result};
22-
use clap::{crate_description, crate_version, Parser};
21+
use anyhow::{Context, Result, anyhow, bail};
22+
use clap::{Parser, crate_description, crate_version};
2323
use stackable_operator::{
2424
cli::Command,
2525
client,

rust/olm-deployer/src/namespace/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use anyhow::Result;
2-
use serde_json::{json, Value};
2+
use serde_json::{Value, json};
33
use stackable_operator::kube::api::{DynamicObject, GroupVersionKind};
44

55
use crate::data;

rust/olm-deployer/src/owner/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ use stackable_operator::{
55
apimachinery::pkg::apis::meta::v1::OwnerReference,
66
},
77
kube::{
8+
Resource,
89
api::{DynamicObject, ResourceExt},
910
discovery::Scope,
10-
Resource,
1111
},
1212
};
1313

rust/olm-deployer/src/resources/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use stackable_operator::{
22
k8s_openapi::api::{apps::v1::Deployment, core::v1::ResourceRequirements},
33
kube::{
4-
api::{DynamicObject, GroupVersionKind},
54
ResourceExt,
5+
api::{DynamicObject, GroupVersionKind},
66
},
77
};
88

rust/olm-deployer/src/tolerations/mod.rs

+11-8
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@ pub(super) fn maybe_copy_tolerations(
1616
if target_gvk.kind == "DaemonSet" {
1717
if let Some(tolerations) = deployment_tolerations(source) {
1818
let path = "template/spec/tolerations".split("/");
19-
*get_or_create(target.data.pointer_mut("/spec").unwrap(), path)? =
20-
serde_json::json!(tolerations
19+
*get_or_create(target.data.pointer_mut("/spec").unwrap(), path)? = serde_json::json!(
20+
tolerations
2121
.iter()
2222
.map(|t| serde_json::json!(t))
23-
.collect::<Vec<serde_json::Value>>());
23+
.collect::<Vec<serde_json::Value>>()
24+
);
2425
}
2526
}
2627

@@ -104,11 +105,13 @@ spec:
104105
let mut daemonset = DAEMONSET.clone();
105106
maybe_copy_tolerations(&DEPLOYMENT, &mut daemonset, &gvk)?;
106107

107-
let expected = serde_json::json!(deployment_tolerations(&DEPLOYMENT)
108-
.unwrap()
109-
.iter()
110-
.map(|t| serde_json::json!(t))
111-
.collect::<Vec<serde_json::Value>>());
108+
let expected = serde_json::json!(
109+
deployment_tolerations(&DEPLOYMENT)
110+
.unwrap()
111+
.iter()
112+
.map(|t| serde_json::json!(t))
113+
.collect::<Vec<serde_json::Value>>()
114+
);
112115

113116
assert_eq!(
114117
daemonset.data.pointer("/spec/template/spec/tolerations"),

rust/operator-binary/src/backend/cert_manager.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ use std::collections::HashSet;
77
use async_trait::async_trait;
88
use snafu::{OptionExt, ResultExt, Snafu};
99
use stackable_operator::{
10-
k8s_openapi::{api::core::v1::Secret, ByteString},
10+
k8s_openapi::{ByteString, api::core::v1::Secret},
1111
kube::{api::ObjectMeta, runtime::reflector::ObjectRef},
1212
time::Duration,
1313
};
1414

1515
use super::{
16+
ScopeAddressesError, SecretBackend, SecretBackendError, SecretContents, SecretVolumeSelector,
1617
k8s_search::LABEL_SCOPE_NODE,
1718
pod_info::{Address, PodInfo, SchedulingPodInfo},
1819
scope::SecretScope,
19-
ScopeAddressesError, SecretBackend, SecretBackendError, SecretContents, SecretVolumeSelector,
2020
};
2121
use crate::{
2222
crd::{self, CertificateKeyGeneration},
@@ -32,7 +32,9 @@ const FIELD_MANAGER_SCOPE: &str = "backend.cert-manager";
3232

3333
#[derive(Debug, Snafu)]
3434
pub enum Error {
35-
#[snafu(display("unable to find PersistentVolumeClaim for volume (try deleting and recreating the Pod, ensure you are using the `ephemeral:` volume type, rather than `csi:`)"))]
35+
#[snafu(display(
36+
"unable to find PersistentVolumeClaim for volume (try deleting and recreating the Pod, ensure you are using the `ephemeral:` volume type, rather than `csi:`)"
37+
))]
3638
NoPvcName,
3739

3840
#[snafu(display("failed to get addresses for scope {:?}", format!("{scope}")))]

rust/operator-binary/src/backend/dynamic.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ use snafu::{ResultExt, Snafu};
1010
use stackable_operator::kube::runtime::reflector::ObjectRef;
1111

1212
use super::{
13+
SecretBackend, SecretBackendError, SecretVolumeSelector,
1314
kerberos_keytab::{self, KerberosProfile},
1415
pod_info::{PodInfo, SchedulingPodInfo},
15-
tls, SecretBackend, SecretBackendError, SecretVolumeSelector,
16+
tls,
1617
};
1718
use crate::{
1819
crd::{self, SecretClass},

rust/operator-binary/src/backend/k8s_search.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ use async_trait::async_trait;
66
use snafu::{OptionExt, ResultExt, Snafu};
77
use stackable_operator::{
88
k8s_openapi::{
9-
api::core::v1::Secret, apimachinery::pkg::apis::meta::v1::LabelSelector, ByteString,
9+
ByteString, api::core::v1::Secret, apimachinery::pkg::apis::meta::v1::LabelSelector,
1010
},
1111
kube::api::ListParams,
1212
kvp::{LabelError, LabelSelectorExt, Labels},
1313
};
1414

1515
use super::{
16+
SecretBackend, SecretBackendError, SecretContents, SecretVolumeSelector,
1617
pod_info::{PodInfo, SchedulingPodInfo},
1718
scope::SecretScope,
18-
SecretBackend, SecretBackendError, SecretContents, SecretVolumeSelector,
1919
};
2020
use crate::{crd::SearchNamespace, format::SecretData, utils::Unloggable};
2121

rust/operator-binary/src/backend/kerberos_keytab.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ use tokio::{
1818
};
1919

2020
use super::{
21-
pod_info::Address, scope::SecretScope, ScopeAddressesError, SecretBackend, SecretBackendError,
22-
SecretContents,
21+
ScopeAddressesError, SecretBackend, SecretBackendError, SecretContents, pod_info::Address,
22+
scope::SecretScope,
2323
};
2424
use crate::{
2525
crd::{
2626
ActiveDirectorySamAccountNameRules, InvalidKerberosPrincipal, KerberosKeytabBackendAdmin,
2727
KerberosPrincipal,
2828
},
29-
format::{well_known, SecretData, WellKnownSecretData},
29+
format::{SecretData, WellKnownSecretData, well_known},
3030
utils::Unloggable,
3131
};
3232

rust/operator-binary/src/backend/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub use k8s_search::K8sSearch;
1616
pub use kerberos_keytab::KerberosKeytab;
1717
use pod_info::Address;
1818
use scope::SecretScope;
19-
use serde::{de::Unexpected, Deserialize, Deserializer, Serialize};
19+
use serde::{Deserialize, Deserializer, Serialize, de::Unexpected};
2020
use snafu::{OptionExt, Snafu};
2121
use stackable_operator::{
2222
k8s_openapi::chrono::{DateTime, FixedOffset},
@@ -26,8 +26,8 @@ pub use tls::TlsGenerate;
2626

2727
use self::pod_info::SchedulingPodInfo;
2828
use crate::format::{
29-
well_known::{CompatibilityOptions, NamingOptions},
3029
SecretData, SecretFormat,
30+
well_known::{CompatibilityOptions, NamingOptions},
3131
};
3232

3333
/// Configuration provided by the `Volume` selecting what secret data should be provided
@@ -302,7 +302,7 @@ impl SecretBackendError for Infallible {
302302
mod tests {
303303
use std::collections::HashMap;
304304

305-
use serde::de::{value::MapDeserializer, IntoDeserializer};
305+
use serde::de::{IntoDeserializer, value::MapDeserializer};
306306

307307
use super::*;
308308

rust/operator-binary/src/backend/tls/ca.rs

+7-5
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,21 @@ use openssl::{
1111
pkey::{PKey, Private},
1212
rsa::Rsa,
1313
x509::{
14+
X509, X509Builder, X509NameBuilder,
1415
extension::{AuthorityKeyIdentifier, BasicConstraints, KeyUsage, SubjectKeyIdentifier},
15-
X509Builder, X509NameBuilder, X509,
1616
},
1717
};
1818
use snafu::{OptionExt, ResultExt, Snafu};
1919
use stackable_operator::{
2020
k8s_openapi::{
21-
api::core::v1::{ConfigMap, Secret},
2221
ByteString,
22+
api::core::v1::{ConfigMap, Secret},
2323
},
2424
kube::{
2525
self,
2626
api::{
27-
entry::{self, Entry},
2827
DynamicObject, PostParams,
28+
entry::{self, Entry},
2929
},
3030
runtime::reflector::ObjectRef,
3131
},
@@ -38,7 +38,7 @@ use tracing::{info, info_span, warn};
3838
use crate::{
3939
backend::SecretBackendError,
4040
crd::{AdditionalTrustRoot, CertificateKeyGeneration},
41-
utils::{asn1time_to_offsetdatetime, Asn1TimeParseError, Unloggable},
41+
utils::{Asn1TimeParseError, Unloggable, asn1time_to_offsetdatetime},
4242
};
4343

4444
/// v1 format: support a single cert/pkey pair
@@ -86,7 +86,9 @@ pub enum Error {
8686
object: ObjectRef<DynamicObject>,
8787
},
8888

89-
#[snafu(display("unsupported certificate format in key {key:?} of {object}; supported extensions: .crt, .der"))]
89+
#[snafu(display(
90+
"unsupported certificate format in key {key:?} of {object}; supported extensions: .crt, .der"
91+
))]
9092
UnsupportedCertificateFormat {
9193
key: String,
9294
object: ObjectRef<DynamicObject>,

0 commit comments

Comments
 (0)