@@ -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