<#7311 patch instead of update to clear finalizers...
# flyte-github
a
#7311 patch instead of update to clear finalizers Pull request opened by pvditt Why are the changes needed? This upstreams unionai/flyte#881. During pod finalization, Flyte currently removes its finalizer using a full Kubernetes
Update
. If the informer cache has stale object state, that full update can conflict and leave pods stuck with finalizers, preventing termination. What changes were proposed in this pull request? • Add a
clear_finalizers_failures
metric for failures while clearing finalizers. • Patch finalizer removal instead of using a full object
Update
, reducing conflicts caused by stale informer cache state. • Preserve the current OSS behavior of removing only Flyte's current and legacy finalizers (
flyte.org/finalizer-k8s
and
flyte/flytek8s
) rather than clearing unrelated finalizers on the resource. The original Union PR cleared
metadata.finalizers
with a raw merge patch. Current OSS had since changed this path to remove only Flyte-owned finalizers, so this upstream keeps that behavior and uses
client.MergeFrom
to patch the finalizer diff. How was this patch tested? cd flytepropeller GOCACHE=/tmp/go-build-cache go test ./pkg/controller/nodes/task/k8s Labels • fixed Check all the applicable boxes • I updated the documentation accordingly. • All new and existing tests passed. • All commits are signed-off. Related PRs • unionai/flyte#881 flyteorg/flyte