Skip to content

Commit 9583068

Browse files
committed
chore: Adjust CRD code to reflect attribute changes
1 parent a86bf17 commit 9583068

File tree

8 files changed

+63
-51
lines changed

8 files changed

+63
-51
lines changed

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

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,14 @@ use crate::versioned::versioned;
66

77
mod v1alpha1_impl;
88

9-
#[versioned(version(name = "v1alpha1"))]
9+
#[versioned(
10+
version(name = "v1alpha1"),
11+
crates(
12+
kube_core = "kube::core",
13+
k8s_openapi = "k8s_openapi",
14+
schemars = "schemars",
15+
)
16+
)]
1017
pub mod versioned {
1118
pub mod v1alpha1 {
1219
// Re-export the v1alpha1-specific error type from the private impl module.
@@ -26,14 +33,9 @@ pub mod versioned {
2633
///
2734
/// [1]: DOCS_BASE_URL_PLACEHOLDER/concepts/authentication
2835
/// [2]: DOCS_BASE_URL_PLACEHOLDER/tutorials/authentication_with_openldap
29-
#[versioned(k8s(
36+
#[versioned(crd(
3037
group = "authentication.stackable.tech",
3138
plural = "authenticationclasses",
32-
crates(
33-
kube_core = "kube::core",
34-
k8s_openapi = "k8s_openapi",
35-
schemars = "schemars",
36-
)
3739
))]
3840
#[derive(
3941
Clone,

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

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@ use serde::{Deserialize, Serialize};
33
use stackable_versioned::versioned;
44

55
#[versioned(version(name = "v1alpha1"))]
6-
#[derive(
7-
Clone, Debug, Deserialize, Eq, Hash, JsonSchema, Ord, PartialEq, PartialOrd, Serialize,
8-
)]
9-
#[serde(rename_all = "camelCase")]
10-
pub struct AuthenticationProvider {
11-
/// Mandatory SecretClass used to obtain keytabs.
12-
pub kerberos_secret_class: String,
6+
pub mod versioned {
7+
#[derive(
8+
Clone, Debug, Deserialize, Eq, Hash, JsonSchema, Ord, PartialEq, PartialOrd, Serialize,
9+
)]
10+
#[serde(rename_all = "camelCase")]
11+
pub struct AuthenticationProvider {
12+
/// Mandatory SecretClass used to obtain keytabs.
13+
pub kerberos_secret_class: String,
14+
}
1315
}

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

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@ use serde::{Deserialize, Serialize};
33
use stackable_versioned::versioned;
44

55
#[versioned(version(name = "v1alpha1"))]
6-
#[derive(
7-
Clone, Debug, Deserialize, Eq, Hash, JsonSchema, Ord, PartialEq, PartialOrd, Serialize,
8-
)]
9-
#[serde(rename_all = "camelCase")]
10-
pub struct AuthenticationProvider {
11-
/// See [ADR017: TLS authentication](DOCS_BASE_URL_PLACEHOLDER/contributor/adr/adr017-tls_authentication).
12-
/// If `client_cert_secret_class` is not set, the TLS settings may also be used for client authentication.
13-
/// If `client_cert_secret_class` is set, the [SecretClass](DOCS_BASE_URL_PLACEHOLDER/secret-operator/secretclass)
14-
/// will be used to provision client certificates.
15-
pub client_cert_secret_class: Option<String>,
6+
pub mod versioned {
7+
#[derive(
8+
Clone, Debug, Deserialize, Eq, Hash, JsonSchema, Ord, PartialEq, PartialOrd, Serialize,
9+
)]
10+
#[serde(rename_all = "camelCase")]
11+
pub struct AuthenticationProvider {
12+
/// See [ADR017: TLS authentication](DOCS_BASE_URL_PLACEHOLDER/contributor/adr/adr017-tls_authentication).
13+
/// If `client_cert_secret_class` is not set, the TLS settings may also be used for client authentication.
14+
/// If `client_cert_secret_class` is set, the [SecretClass](DOCS_BASE_URL_PLACEHOLDER/secret-operator/secretclass)
15+
/// will be used to provision client certificates.
16+
pub client_cert_secret_class: Option<String>,
17+
}
1618
}

crates/stackable-operator/src/crd/listener/class/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub mod versioned {
2525
/// Defines a policy for how [Listeners](DOCS_BASE_URL_PLACEHOLDER/listener-operator/listener) should be exposed.
2626
/// Read the [ListenerClass documentation](DOCS_BASE_URL_PLACEHOLDER/listener-operator/listenerclass)
2727
/// for more information.
28-
#[versioned(k8s(group = "listeners.stackable.tech"))]
28+
#[versioned(crd(group = "listeners.stackable.tech"))]
2929
#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, JsonSchema, PartialEq, Eq)]
3030
#[serde(rename_all = "camelCase")]
3131
pub struct ListenerClassSpec {

crates/stackable-operator/src/crd/listener/listeners/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ pub mod versioned {
4949
/// ["sticky" scheduling](DOCS_BASE_URL_PLACEHOLDER/listener-operator/listener#_sticky_scheduling).
5050
///
5151
/// Learn more in the [Listener documentation](DOCS_BASE_URL_PLACEHOLDER/listener-operator/listener).
52-
#[versioned(k8s(
52+
#[versioned(crd(
5353
group = "listeners.stackable.tech",
5454
status = "v1alpha1::ListenerStatus",
5555
namespaced
@@ -79,7 +79,7 @@ pub mod versioned {
7979
/// This is not expected to be created or modified by users. It will be created by
8080
/// the Stackable Listener Operator when mounting the listener volume, and is always
8181
/// named `pod-{pod.metadata.uid}`.
82-
#[versioned(k8s(
82+
#[versioned(crd(
8383
group = "listeners.stackable.tech",
8484
plural = "podlisteners",
8585
namespaced,

crates/stackable-operator/src/crd/s3/bucket/mod.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,25 @@ use crate::{crd::s3::connection::v1alpha1 as conn_v1alpha1, versioned::versioned
66

77
mod v1alpha1_impl;
88

9-
#[versioned(version(name = "v1alpha1"))]
9+
#[versioned(
10+
version(name = "v1alpha1"),
11+
crates(
12+
kube_core = "kube::core",
13+
k8s_openapi = "k8s_openapi",
14+
schemars = "schemars",
15+
)
16+
)]
1017
pub mod versioned {
1118
pub mod v1alpha1 {
1219
pub use v1alpha1_impl::BucketError;
1320
}
1421

1522
/// S3 bucket specification containing the bucket name and an inlined or referenced connection specification.
1623
/// Learn more on the [S3 concept documentation](DOCS_BASE_URL_PLACEHOLDER/concepts/s3).
17-
#[versioned(k8s(
24+
#[versioned(crd(
1825
group = "s3.stackable.tech",
1926
kind = "S3Bucket",
2027
plural = "s3buckets",
21-
crates(
22-
kube_core = "kube::core",
23-
k8s_openapi = "k8s_openapi",
24-
schemars = "schemars",
25-
),
2628
namespaced
2729
))]
2830
#[derive(Clone, CustomResource, Debug, Deserialize, Eq, JsonSchema, PartialEq, Serialize)]

crates/stackable-operator/src/crd/s3/connection/mod.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,25 @@ mod v1alpha1_impl;
1616
/// Use this type in you operator!
1717
pub type ResolvedConnection = v1alpha1::ConnectionSpec;
1818

19-
#[versioned(version(name = "v1alpha1"))]
19+
#[versioned(
20+
version(name = "v1alpha1"),
21+
crates(
22+
kube_core = "kube::core",
23+
k8s_openapi = "k8s_openapi",
24+
schemars = "schemars",
25+
)
26+
)]
2027
pub mod versioned {
2128
pub mod v1alpha1 {
2229
pub use v1alpha1_impl::ConnectionError;
2330
}
2431

2532
/// S3 connection definition as a resource.
2633
/// Learn more on the [S3 concept documentation](DOCS_BASE_URL_PLACEHOLDER/concepts/s3).
27-
#[versioned(k8s(
34+
#[versioned(crd(
2835
group = "s3.stackable.tech",
2936
kind = "S3Connection",
3037
plural = "s3connections",
31-
crates(
32-
kube_core = "kube::core",
33-
k8s_openapi = "k8s_openapi",
34-
schemars = "schemars",
35-
),
3638
namespaced
3739
))]
3840
#[derive(CustomResource, Clone, Debug, Deserialize, Eq, JsonSchema, PartialEq, Serialize)]

crates/xtask/src/crd/dummy.rs

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,27 @@ use stackable_operator::{
44
config::fragment::Fragment,
55
kube::CustomResource,
66
role_utils::Role,
7-
schemars::JsonSchema,
7+
schemars::{self, JsonSchema},
88
status::condition::ClusterCondition,
99
versioned::versioned,
1010
};
1111

12-
#[versioned(version(name = "v1alpha1"))]
12+
#[versioned(
13+
version(name = "v1alpha1"),
14+
crates(
15+
kube_core = "stackable_operator::kube::core",
16+
kube_client = "stackable_operator::kube::client",
17+
k8s_openapi = "stackable_operator::k8s_openapi",
18+
schemars = "stackable_operator::schemars",
19+
versioned = "stackable_operator::versioned"
20+
)
21+
)]
1322
pub mod versioned {
14-
#[versioned(k8s(
23+
#[versioned(crd(
1524
group = "dummy.stackable.tech",
1625
kind = "DummyCluster",
1726
status = "v1alpha1::DummyClusterStatus",
1827
namespaced,
19-
crates(
20-
kube_core = "stackable_operator::kube::core",
21-
kube_client = "stackable_operator::kube::client",
22-
k8s_openapi = "stackable_operator::k8s_openapi",
23-
schemars = "stackable_operator::schemars",
24-
versioned = "stackable_operator::versioned"
25-
)
2628
))]
2729
#[derive(Clone, CustomResource, Debug, Deserialize, JsonSchema, PartialEq, Serialize)]
2830
#[schemars(crate = "stackable_operator::schemars")]

0 commit comments

Comments
 (0)