Skip to content

Commit a73e368

Browse files
committed
Improve rust docs
1 parent 23c2531 commit a73e368

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

crates/stackable-webhook/src/servers/conversion.rs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -122,21 +122,24 @@ impl ConversionWebhookServer {
122122
/// };
123123
///
124124
/// # async fn test() {
125-
/// let crds_and_handlers = [
125+
/// // Things that should already be in you operator:
126+
/// const OPERATOR_NAME: &str = "product-operator";
127+
/// let client = Client::try_default().await.expect("failed to create Kubernetes client");
128+
/// let operator_environment = OperatorEnvironmentOptions::parse();
129+
///
130+
/// let crds_and_handlers = [
126131
/// (
127132
/// S3Connection::merged_crd(S3ConnectionVersion::V1Alpha1)
128133
/// .expect("failed to merge S3Connection CRD"),
129134
/// S3Connection::try_convert as fn(_) -> _,
130135
/// ),
131136
/// ];
132137
///
133-
/// let client = Client::try_default().await.expect("failed to create Kubernetes client");
134-
///
135138
/// let options = ConversionWebhookOptions {
136-
/// socket_addr: "127.0.0.1:8080".parse().unwrap(),
137-
/// field_manager: "product-operator".to_owned(),
138-
/// namespace: "default".to_owned(),
139-
/// service_name: "product-operator".to_owned(),
139+
/// socket_addr: "127.0.0.1:8443".parse().unwrap(),
140+
/// field_manager: OPERATOR_NAME.to_owned(),
141+
/// namespace: operator_environment.operator_namespace,
142+
/// service_name: operator_environment.operator_service_name,
140143
/// };
141144
///
142145
/// // Construct the conversion webhook server

0 commit comments

Comments
 (0)