Skip to content

Commit 442031d

Browse files
committed
fix(stackable-operator): Re-export versioned error types
1 parent d62914b commit 442031d

File tree

5 files changed

+28
-11
lines changed

5 files changed

+28
-11
lines changed

crates/stackable-operator/src/crd/authentication/core/mod.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
use kube::CustomResource;
22
use schemars::JsonSchema;
33
use serde::{Deserialize, Serialize};
4-
use stackable_versioned::versioned;
4+
5+
use crate::versioned::versioned;
56

67
mod v1alpha1_impl;
78

89
#[versioned(version(name = "v1alpha1"))]
910
pub mod versioned {
10-
// This makes v1alpha1 versions of all authentication providers available to the
11-
// AuthenticationClassProvider enum below.
1211
mod v1alpha1 {
12+
// Re-export the v1alpha1-specific error type from the private impl module.
13+
pub use v1alpha1_impl::Error;
14+
15+
// This makes v1alpha1 versions of all authentication providers available to the
16+
// AuthenticationClassProvider enum below.
1317
use crate::crd::authentication::{kerberos, ldap, oidc, r#static, tls};
1418
}
1519
/// The Stackable Platform uses the AuthenticationClass as a central mechanism to handle user

crates/stackable-operator/src/crd/authentication/ldap/mod.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,22 @@
11
use schemars::JsonSchema;
22
use serde::{Deserialize, Serialize};
3-
use stackable_versioned::versioned;
43

5-
use crate::commons::{
6-
networking::HostName, secret_class::SecretClassVolume, tls_verification::TlsClientDetails,
4+
use crate::{
5+
commons::{
6+
networking::HostName, secret_class::SecretClassVolume, tls_verification::TlsClientDetails,
7+
},
8+
versioned::versioned,
79
};
810

911
mod v1alpha1_impl;
1012

1113
#[versioned(version(name = "v1alpha1"))]
1214
pub mod versioned {
15+
mod v1alpha1 {
16+
// Re-export the v1alpha1-specific error type from the private impl module.
17+
pub use v1alpha1_impl::Error;
18+
}
19+
1320
#[derive(
1421
Clone, Debug, Deserialize, Eq, Hash, JsonSchema, Ord, PartialEq, PartialOrd, Serialize,
1522
)]

crates/stackable-operator/src/crd/authentication/ldap/v1alpha1_impl.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use k8s_openapi::api::core::v1::{Volume, VolumeMount};
22
use snafu::{ResultExt as _, Snafu};
3-
use url::{ParseError, Url};
3+
use url::Url;
44

55
use crate::{
66
builder::{
@@ -22,7 +22,7 @@ pub enum Error {
2222
BindCredentials { source: SecretClassVolumeError },
2323

2424
#[snafu(display("failed to parse LDAP endpoint url"))]
25-
ParseLdapEndpointUrl { source: ParseError },
25+
ParseLdapEndpointUrl { source: url::ParseError },
2626

2727
#[snafu(display("failed to add LDAP TLS client details volumes and volume mounts"))]
2828
AddLdapTlsClientDetailsVolumes { source: TlsClientDetailsError },

crates/stackable-operator/src/crd/authentication/oidc/mod.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
use schemars::JsonSchema;
22
use serde::{Deserialize, Serialize};
3-
use stackable_versioned::versioned;
43
#[cfg(doc)]
54
use url::Url;
65

7-
use crate::commons::{networking::HostName, tls_verification::TlsClientDetails};
6+
use crate::{
7+
commons::{networking::HostName, tls_verification::TlsClientDetails},
8+
versioned::versioned,
9+
};
810

911
mod v1alpha1_impl;
1012

@@ -17,6 +19,11 @@ const DEFAULT_WELLKNOWN_OIDC_CONFIG_PATH: &str = "/.well-known/openid-configurat
1719

1820
#[versioned(version(name = "v1alpha1"))]
1921
pub mod versioned {
22+
mod v1alpha1 {
23+
// Re-export the v1alpha1-specific error type from the private impl module.
24+
pub use v1alpha1_impl::Error;
25+
}
26+
2027
/// This struct contains configuration values to configure an OpenID Connect
2128
/// (OIDC) authentication class. Required fields are the identity provider
2229
/// (IdP) `hostname` and the TLS configuration. The `port` is selected

crates/stackable-operator/src/crd/authentication/oidc/v1alpha1_impl.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ use crate::{
1818

1919
pub type Result<T, E = Error> = std::result::Result<T, E>;
2020

21-
// TODO (@Techassi): Move this into mod.rs
2221
#[derive(Debug, PartialEq, Snafu)]
2322
pub enum Error {
2423
#[snafu(display("failed to parse OIDC endpoint url"))]

0 commit comments

Comments
 (0)