Skip to content

Commit 781bdb5

Browse files
committed
chore: Handle CRD management CLI flag
1 parent 82138a5 commit 781bdb5

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

rust/operator-binary/src/main.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ async fn main() -> anyhow::Result<()> {
9292
product_config: _,
9393
watch_namespace,
9494
operator_environment,
95+
disable_crd_maintenance,
9596
},
9697
}) => {
9798
// NOTE (@NickLarsenNZ): Before stackable-telemetry was used:
@@ -150,10 +151,13 @@ async fn main() -> anyhow::Result<()> {
150151
let truststore_controller =
151152
truststore_controller::start(&client, &watch_namespace).map(anyhow::Ok);
152153

153-
let conversion_webhook =
154-
conversion_webhook(client.as_kube_client(), operator_environment)
155-
.await
156-
.context("failed to create conversion webhook")?;
154+
let conversion_webhook = conversion_webhook(
155+
client.as_kube_client(),
156+
operator_environment,
157+
disable_crd_maintenance,
158+
)
159+
.await
160+
.context("failed to create conversion webhook")?;
157161
let conversion_webhook = conversion_webhook
158162
.run()
159163
.map_err(|err| anyhow!(err).context("failed to run conversion webhook"));

rust/operator-binary/src/webhooks/conversion.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ use crate::{
1515
pub async fn conversion_webhook(
1616
client: Client,
1717
operator_environment: OperatorEnvironmentOptions,
18+
disable_crd_management: bool,
1819
) -> anyhow::Result<ConversionWebhookServer> {
1920
let crds_and_handlers = [
2021
(
@@ -34,6 +35,7 @@ pub async fn conversion_webhook(
3435
field_manager: OPERATOR_NAME.to_owned(),
3536
namespace: operator_environment.operator_namespace,
3637
service_name: operator_environment.operator_service_name,
38+
maintain_crds: !disable_crd_management,
3739
};
3840

3941
Ok(ConversionWebhookServer::new(crds_and_handlers, options, client).await?)

0 commit comments

Comments
 (0)