From 08f8630e57b27c6714cb8e51324019464d12c01d Mon Sep 17 00:00:00 2001 From: Oliver Gould Date: Mon, 25 Nov 2024 17:59:23 +0000 Subject: [PATCH] fix(policy): set an informative field manager on patches When the policy controller patches a status, it sets the field manager to be that of the Kind of resource being managed. Per the Kubernetes documentation, this field should describe the controller that is making the change: > Managers identify distinct workflows that are modifying the object (especially > useful on conflicts!), and can be specified through the fieldManager query > parameter as part of a modifying request. When you Apply to a resource, the > fieldManager parameter is required. For other updates, the API server infers a > field manager identity from the "User-Agent:" HTTP header (if present). > > When you use the kubectl tool to perform a Server-Side Apply operation, > kubectl sets the manager identity to "kubectl" by default. This commit sets the field manager to "linkerd.io/policy-controller", as is used in status values. --- policy-controller/k8s/status/src/index.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/policy-controller/k8s/status/src/index.rs b/policy-controller/k8s/status/src/index.rs index 2213c3e3a036f..37a6175fbe135 100644 --- a/policy-controller/k8s/status/src/index.rs +++ b/policy-controller/k8s/status/src/index.rs @@ -313,7 +313,7 @@ impl Controller { { tracing::trace!(?patch); let api = k8s_core_api::Api::::namespaced(self.client.clone(), namespace); - let patch_params = k8s_core_api::PatchParams::apply(&K::group(&Default::default())); + let patch_params = k8s_core_api::PatchParams::apply(POLICY_CONTROLLER_NAME); let start = time::Instant::now(); let result = time::timeout( self.patch_timeout,