Skip to content

Commit

Permalink
fix(policy): set an informative field manager on patches
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
olix0r committed Nov 25, 2024
1 parent 8565694 commit 221dd6f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion policy-controller/k8s/status/src/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ impl Controller {
{
tracing::trace!(?patch);
let api = k8s_core_api::Api::<K>::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,
Expand Down

0 comments on commit 221dd6f

Please sign in to comment.