Skip to content

Commit 99da9bb

Browse files
committed
fix merge conflicts
1 parent d846d68 commit 99da9bb

3 files changed

Lines changed: 45 additions & 44 deletions

File tree

crates/stackable-webhook/src/lib.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,9 @@
33
//!
44
//! Currently the following webhooks are supported:
55
//!
6-
<<<<<<< HEAD
7-
//! ```
8-
//! use axum::Router;
9-
//! use stackable_webhook::{WebhookOptions, WebhookServer};
10-
=======
116
//! * [webhooks::ConversionWebhook]
127
//! * [webhooks::MutatingWebhook]
138
//! * In the future validating webhooks wil be added
14-
>>>>>>> origin/main
159
//!
1610
//! This library is fully compatible with the [`tracing`] crate and emits debug level tracing data.
1711
//!
@@ -64,9 +58,7 @@ pub enum WebhookServerError {
6458
/// ### Example usage
6559
///
6660
/// ```
67-
/// use stackable_webhook::WebhookServer;
68-
/// use stackable_webhook::WebhookServerOptions;
69-
/// use stackable_webhook::webhooks::Webhook;
61+
/// use stackable_webhook::{WebhookServer, WebhookServerOptions, webhooks::Webhook};
7062
///
7163
/// # async fn docs() {
7264
/// let mut webhooks: Vec<Box<dyn Webhook>> = vec![];

crates/stackable-webhook/src/webhooks/conversion_webhook.rs

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -43,40 +43,41 @@ pub enum ConversionWebhookError {
4343
/// ```
4444
/// use std::sync::Arc;
4545
///
46-
/// use stackable_operator::crd::s3::{S3Connection, S3ConnectionVersion};
47-
/// use stackable_operator::kube::{Client, core::admission::{AdmissionRequest, AdmissionResponse}};
48-
/// use stackable_webhook::WebhookServer;
49-
/// use stackable_webhook::webhooks::{ConversionWebhook, ConversionWebhookOptions};
46+
/// use stackable_operator::{
47+
/// crd::s3::{S3Connection, S3ConnectionVersion},
48+
/// kube::{
49+
/// Client,
50+
/// core::admission::{AdmissionRequest, AdmissionResponse},
51+
/// },
52+
/// };
53+
/// use stackable_webhook::{
54+
/// WebhookServer,
55+
/// webhooks::{ConversionWebhook, ConversionWebhookOptions},
56+
/// };
5057
///
5158
/// # async fn docs() {
5259
/// // The Kubernetes client
5360
/// let client = Client::try_default().await.unwrap();
5461
/// // Read in from user input, e.g. CLI arguments
5562
/// let disable_crd_maintenance = false;
5663
///
57-
/// let crds_and_handlers = vec![
58-
/// (
59-
/// S3Connection::merged_crd(S3ConnectionVersion::V1Alpha1)
60-
/// .expect("the S3Connection CRD must be merged"),
61-
/// S3Connection::try_convert,
62-
/// )
63-
/// ];
64+
/// let crds_and_handlers = vec![(
65+
/// S3Connection::merged_crd(S3ConnectionVersion::V1Alpha1)
66+
/// .expect("the S3Connection CRD must be merged"),
67+
/// S3Connection::try_convert,
68+
/// )];
6469
///
65-
/// let conversion_webhook_options = ConversionWebhookOptions{
70+
/// let conversion_webhook_options = ConversionWebhookOptions {
6671
/// disable_crd_maintenance,
6772
/// field_manager: "my-field-manager".to_owned(),
6873
/// };
69-
/// let (conversion_webhook, initial_reconcile_rx) = ConversionWebhook::new(
70-
/// crds_and_handlers,
71-
/// client,
72-
/// conversion_webhook_options,
73-
/// );
74+
/// let (conversion_webhook, initial_reconcile_rx) =
75+
/// ConversionWebhook::new(crds_and_handlers, client, conversion_webhook_options);
7476
///
7577
/// let webhook_options = todo!();
76-
/// let webhook_server = WebhookServer::new(
77-
/// vec![Box::new(conversion_webhook)],
78-
/// webhook_options,
79-
/// ).await.unwrap();
78+
/// let webhook_server = WebhookServer::new(vec![Box::new(conversion_webhook)], webhook_options)
79+
/// .await
80+
/// .unwrap();
8081
/// webhook_server.run().await.unwrap();
8182
/// # }
8283
/// ```

crates/stackable-webhook/src/webhooks/mutating_webhook.rs

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,17 @@ pub enum MutatingWebhookError {
4040
/// ```
4141
/// use std::sync::Arc;
4242
///
43-
/// use k8s_openapi::api::admissionregistration::v1::MutatingWebhookConfiguration;
44-
/// use k8s_openapi::api::apps::v1::StatefulSet;
45-
///
46-
/// use stackable_operator::kube::Client;
47-
/// use stackable_operator::kube::core::admission::{AdmissionRequest, AdmissionResponse};
48-
/// use stackable_webhook::WebhookServer;
49-
/// use stackable_webhook::webhooks::{MutatingWebhook, MutatingWebhookOptions};
43+
/// use k8s_openapi::api::{
44+
/// admissionregistration::v1::MutatingWebhookConfiguration, apps::v1::StatefulSet,
45+
/// };
46+
/// use stackable_operator::kube::{
47+
/// Client,
48+
/// core::admission::{AdmissionRequest, AdmissionResponse},
49+
/// };
50+
/// use stackable_webhook::{
51+
/// WebhookServer,
52+
/// webhooks::{MutatingWebhook, MutatingWebhookOptions},
53+
/// };
5054
///
5155
/// # async fn docs() {
5256
/// // The Kubernetes client
@@ -56,7 +60,7 @@ pub enum MutatingWebhookError {
5660
/// // Read in from user input, e.g. CLI arguments
5761
/// let disable_mwc_maintenance = false;
5862
///
59-
/// let mutating_webhook_options = MutatingWebhookOptions{
63+
/// let mutating_webhook_options = MutatingWebhookOptions {
6064
/// disable_mwc_maintenance,
6165
/// field_manager: "my-field-manager".to_owned(),
6266
/// };
@@ -69,19 +73,23 @@ pub enum MutatingWebhookError {
6973
/// ));
7074
///
7175
/// let webhook_options = todo!();
72-
/// let webhook_server = WebhookServer::new(vec![mutating_webhook], webhook_options).await.unwrap();
76+
/// let webhook_server = WebhookServer::new(vec![mutating_webhook], webhook_options)
77+
/// .await
78+
/// .unwrap();
7379
/// webhook_server.run().await.unwrap();
7480
/// # }
7581
///
7682
/// fn get_mutating_webhook_configuration() -> MutatingWebhookConfiguration {
7783
/// let webhook_name = "pod-labeler.stackable.tech";
7884
///
7985
/// MutatingWebhookConfiguration {
80-
/// webhooks: Some(vec![k8s_openapi::api::admissionregistration::v1::MutatingWebhook {
81-
/// // This is checked by the stackable_webhook code
82-
/// admission_review_versions: vec!["v1".to_owned()],
83-
/// ..Default::default()
84-
/// }]),
86+
/// webhooks: Some(vec![
87+
/// k8s_openapi::api::admissionregistration::v1::MutatingWebhook {
88+
/// // This is checked by the stackable_webhook code
89+
/// admission_review_versions: vec!["v1".to_owned()],
90+
/// ..Default::default()
91+
/// },
92+
/// ]),
8593
/// ..Default::default()
8694
/// }
8795
/// }

0 commit comments

Comments
 (0)