Skip to content

Commit 64dfc15

Browse files
chore: Update templated files (f1f1a9e) (#730)
* 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 7102f3f. * Revert "ci: use nightly toolchain for cargo udeps" This reverts commit bf3d30a. --------- Co-authored-by: Nick Larsen <[email protected]>
1 parent 36b604b commit 64dfc15

32 files changed

+282
-251
lines changed

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

Lines changed: 4 additions & 4 deletions
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

Lines changed: 6 additions & 3 deletions
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

Lines changed: 7 additions & 0 deletions
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+
}

nix/sources.json

Lines changed: 4 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
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/operator-binary/src/authentication/mod.rs

Lines changed: 36 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ use snafu::{OptionExt, ResultExt, Snafu};
1313
use stackable_operator::{
1414
builder::{
1515
self,
16-
pod::{container::ContainerBuilder, PodBuilder},
16+
pod::{PodBuilder, container::ContainerBuilder},
1717
},
1818
commons::{
1919
authentication::{AuthenticationClass, AuthenticationClassProvider},
2020
product_image_selection::ResolvedProductImage,
2121
},
2222
k8s_openapi::api::core::v1::{Container, EnvVar, Volume, VolumeMount},
23-
kube::{runtime::reflector::ObjectRef, ResourceExt},
23+
kube::{ResourceExt, runtime::reflector::ObjectRef},
2424
};
2525
use strum::EnumDiscriminants;
2626
use tracing::trace;
@@ -29,11 +29,11 @@ use crate::{
2929
authentication::{
3030
oidc::{OidcAuthenticator, TrinoOidcAuthentication},
3131
password::{
32-
file::FileAuthenticator, ldap::LdapAuthenticator, TrinoPasswordAuthentication,
33-
TrinoPasswordAuthenticator,
32+
TrinoPasswordAuthentication, TrinoPasswordAuthenticator, file::FileAuthenticator,
33+
ldap::LdapAuthenticator,
3434
},
3535
},
36-
crd::{authentication::ResolvedAuthenticationClassRef, TrinoRole},
36+
crd::{TrinoRole, authentication::ResolvedAuthenticationClassRef},
3737
};
3838

3939
pub(crate) mod oidc;
@@ -44,7 +44,9 @@ const HTTP_SERVER_AUTHENTICATION_TYPE: &str = "http-server.authentication.type";
4444

4545
#[derive(Snafu, Debug)]
4646
pub enum Error {
47-
#[snafu(display("The Trino Operator does not support the AuthenticationClass provider [{authentication_class_provider}] from AuthenticationClass [{authentication_class}]."))]
47+
#[snafu(display(
48+
"The Trino Operator does not support the AuthenticationClass provider [{authentication_class_provider}] from AuthenticationClass [{authentication_class}]."
49+
))]
4850
AuthenticationClassProviderNotSupported {
4951
authentication_class_provider: String,
5052
authentication_class: ObjectRef<AuthenticationClass>,
@@ -61,7 +63,9 @@ pub enum Error {
6163
#[snafu(display("Failed to configure trino OAuth2 authentication"))]
6264
InvalidOauth2AuthenticationConfig { source: oidc::Error },
6365

64-
#[snafu(display("OIDC authentication details not specified. The AuthenticationClass {auth_class_name:?} uses an OIDC provider, you need to specify OIDC authentication details (such as client credentials) as well"))]
66+
#[snafu(display(
67+
"OIDC authentication details not specified. The AuthenticationClass {auth_class_name:?} uses an OIDC provider, you need to specify OIDC authentication details (such as client credentials) as well"
68+
))]
6569
OidcAuthenticationDetailsNotSpecified { auth_class_name: String },
6670

6771
#[snafu(display("failed to add needed volume"))]
@@ -740,9 +744,11 @@ mod tests {
740744
#[test]
741745
fn test_trino_password_authenticator_config_files() {
742746
// Nothing for workers
743-
assert!(setup_authentication_config()
744-
.config_files(&TrinoRole::Worker)
745-
.is_empty());
747+
assert!(
748+
setup_authentication_config()
749+
.config_files(&TrinoRole::Worker)
750+
.is_empty()
751+
);
746752

747753
// coordinators
748754
let config_files = setup_authentication_config().config_files(&TrinoRole::Coordinator);
@@ -791,12 +797,16 @@ mod tests {
791797
#[test]
792798
fn test_trino_password_authenticator_volume_mounts() {
793799
// nothing for workers
794-
assert!(setup_authentication_config()
795-
.volume_mounts(&TrinoRole::Worker, &crate::crd::Container::Trino,)
796-
.is_empty());
797-
assert!(setup_authentication_config()
798-
.volume_mounts(&TrinoRole::Worker, &crate::crd::Container::Prepare,)
799-
.is_empty());
800+
assert!(
801+
setup_authentication_config()
802+
.volume_mounts(&TrinoRole::Worker, &crate::crd::Container::Trino,)
803+
.is_empty()
804+
);
805+
assert!(
806+
setup_authentication_config()
807+
.volume_mounts(&TrinoRole::Worker, &crate::crd::Container::Prepare,)
808+
.is_empty()
809+
);
800810

801811
// coordinator - main container
802812
let coordinator_main_mounts = setup_authentication_config()
@@ -817,12 +827,16 @@ mod tests {
817827
let auth_config_with_ldap_bind = setup_authentication_config_bind_credentials();
818828

819829
// nothing for workers
820-
assert!(auth_config
821-
.commands(&TrinoRole::Worker, &crate::crd::Container::Trino)
822-
.is_empty());
823-
assert!(auth_config_with_ldap_bind
824-
.commands(&TrinoRole::Worker, &crate::crd::Container::Trino)
825-
.is_empty());
830+
assert!(
831+
auth_config
832+
.commands(&TrinoRole::Worker, &crate::crd::Container::Trino)
833+
.is_empty()
834+
);
835+
assert!(
836+
auth_config_with_ldap_bind
837+
.commands(&TrinoRole::Worker, &crate::crd::Container::Trino)
838+
.is_empty()
839+
);
826840

827841
// we expect 0 entries because no bind credentials env export
828842
assert_eq!(

rust/operator-binary/src/authentication/oidc/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use stackable_operator::commons::{authentication::oidc, tls_verification::TlsCli
77
use crate::{
88
authentication::TrinoAuthenticationConfig,
99
command,
10-
crd::{TrinoRole, STACKABLE_CLIENT_TLS_DIR},
10+
crd::{STACKABLE_CLIENT_TLS_DIR, TrinoRole},
1111
};
1212

1313
// Trino properties

rust/operator-binary/src/authentication/password/mod.rs

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ use tracing::trace;
1616

1717
use crate::{
1818
authentication::{
19-
password::{file::FileAuthenticator, ldap::LdapAuthenticator},
2019
TrinoAuthenticationConfig,
20+
password::{file::FileAuthenticator, ldap::LdapAuthenticator},
2121
},
22-
crd::{Container, TrinoRole, RW_CONFIG_DIR_NAME},
22+
crd::{Container, RW_CONFIG_DIR_NAME, TrinoRole},
2323
};
2424

2525
pub mod file;
@@ -299,24 +299,32 @@ mod tests {
299299
// check file auth
300300
assert_eq!(
301301
config_files.get(&file_auth_1.config_file_name()).unwrap(),
302-
&format!("file.password-file=/stackable/users/{FILE_AUTH_CLASS_1}.db\npassword-authenticator.name=file\n")
302+
&format!(
303+
"file.password-file=/stackable/users/{FILE_AUTH_CLASS_1}.db\npassword-authenticator.name=file\n"
304+
)
303305
);
304306
// check ldap
305-
assert!(config_files
306-
.get(&ldap_auth_1.config_file_name())
307-
.unwrap()
308-
.contains("password-authenticator.name=ldap"));
307+
assert!(
308+
config_files
309+
.get(&ldap_auth_1.config_file_name())
310+
.unwrap()
311+
.contains("password-authenticator.name=ldap")
312+
);
309313

310314
// Coordinator
311-
assert!(!auth_config
312-
.volume_mounts(&TrinoRole::Coordinator, &Container::Trino)
313-
.is_empty());
315+
assert!(
316+
!auth_config
317+
.volume_mounts(&TrinoRole::Coordinator, &Container::Trino)
318+
.is_empty()
319+
);
314320
assert!(!auth_config.volumes().is_empty());
315321

316322
// Nothing to be set for workers
317-
assert!(auth_config
318-
.volume_mounts(&TrinoRole::Worker, &Container::Trino)
319-
.is_empty());
323+
assert!(
324+
auth_config
325+
.volume_mounts(&TrinoRole::Worker, &Container::Trino)
326+
.is_empty()
327+
);
320328
assert!(auth_config.config_files(&TrinoRole::Worker).is_empty());
321329
}
322330
}

rust/operator-binary/src/catalog/black_hole.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use async_trait::async_trait;
22
use stackable_operator::client::Client;
33

4-
use super::{config::CatalogConfig, FromTrinoCatalogError, ToCatalogConfig};
4+
use super::{FromTrinoCatalogError, ToCatalogConfig, config::CatalogConfig};
55
use crate::crd::catalog::black_hole::BlackHoleConnector;
66

77
pub const CONNECTOR_NAME: &str = "blackhole";

rust/operator-binary/src/catalog/commons.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use async_trait::async_trait;
2-
use snafu::{ensure, OptionExt, ResultExt};
2+
use snafu::{OptionExt, ResultExt, ensure};
33
use stackable_operator::{
44
builder::pod::volume::{VolumeBuilder, VolumeMountBuilder},
55
client::Client,
@@ -11,19 +11,19 @@ use stackable_operator::{
1111
};
1212

1313
use super::{
14+
ExtendCatalogConfig, FromTrinoCatalogError,
1415
config::CatalogConfig,
1516
from_trino_catalog_error::{
1617
ConfigureS3Snafu, FailedToGetDiscoveryConfigMapDataKeySnafu,
1718
FailedToGetDiscoveryConfigMapDataSnafu, FailedToGetDiscoveryConfigMapSnafu,
1819
ObjectHasNoNamespaceSnafu, S3TlsNoVerificationNotSupportedSnafu, S3TlsRequiredSnafu,
1920
},
20-
ExtendCatalogConfig, FromTrinoCatalogError,
2121
};
2222
use crate::{
2323
command,
2424
crd::{
25-
catalog::commons::{HdfsConnection, MetastoreConnection},
2625
CONFIG_DIR_NAME, STACKABLE_CLIENT_TLS_DIR,
26+
catalog::commons::{HdfsConnection, MetastoreConnection},
2727
},
2828
};
2929

0 commit comments

Comments
 (0)