Skip to main content

lib/k8s/patchUtils

Functions

FunctionDescription
computePatchOperationsComputes RFC 6902 JSON Patch operations between two resource objects, filtering out server-managed fields (resourceVersion, managedFields, generation, status) which the server manages and would reintroduce the 409 conflict the patch is meant to avoid.
computeRawPatchCountReturns the total number of raw diff operations between two objects, ignoring /metadata/managedFields diffs (which are produced as a side-effect of EditorDialog's default "Hide Managed Fields" rendering and do not represent user-intent changes).
normalizeBaselineForPatchReturns a clone of the given resource with metadata.managedFields stripped.