Skip to content

Commit 16ed410

Browse files
committed
refactor(webhook): Make field manager a separate field
1 parent 0508e1b commit 16ed410

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

crates/stackable-webhook/src/maintainer.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ impl<'a> CustomResourceDefinitionMaintainer<'a> {
144144
operator_namespace,
145145
webhook_https_port,
146146
operator_name,
147+
field_manager,
147148
disabled,
148149
} = self.options;
149150

@@ -211,7 +212,7 @@ impl<'a> CustomResourceDefinitionMaintainer<'a> {
211212

212213
// Deploy the updated CRDs using a server-side apply.
213214
let patch = Patch::Apply(&crd);
214-
let patch_params = PatchParams::apply(operator_name);
215+
let patch_params = PatchParams::apply(field_manager);
215216
crd_api
216217
.patch(&crd_name, &patch_params, &patch)
217218
.await
@@ -241,6 +242,9 @@ pub struct CustomResourceDefinitionMaintainerOptions<'a> {
241242
/// The namespace the operator/conversion webhook runs in.
242243
pub operator_namespace: &'a str,
243244

245+
/// The field manager used when maintaining the CRDs.
246+
pub field_manager: &'a str,
247+
244248
/// The HTTPS port the conversion webhook listens on.
245249
pub webhook_https_port: u16,
246250

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ impl ConversionWebhookServer {
265265
crds_and_handlers: impl IntoIterator<Item = (CustomResourceDefinition, H)> + Clone,
266266
operator_name: &'a str,
267267
operator_namespace: &'a str,
268+
field_manager: &'a str,
268269
disable_maintainer: bool,
269270
client: Client,
270271
) -> Result<
@@ -298,6 +299,7 @@ impl ConversionWebhookServer {
298299
disabled: disable_maintainer,
299300
operator_namespace,
300301
operator_name,
302+
field_manager,
301303
};
302304

303305
let (maintainer, initial_reconcile_rx) = CustomResourceDefinitionMaintainer::new(

0 commit comments

Comments
 (0)