The csaupgrade.UpgradeManagedFields utility is meant to upgrade existing resources from using client-side apply to server-side apply by modifying the managed fields so that "Update" entries of the manager that did CSA are updated to "Apply" using a new manager.
This transformation is done only in memory and is meant to be persisted to the server by the client. Using neither client.Update(ctx, upgradedObj) nor client.Patch(ctx, origObj, client.MergeFrom(upgradedObj)) works correctly and the object ends up with an "Update" record in the managed fields instead of the expected "Apply".
I put together a simple reproducer for the bug:
https://github.com/metlos/fake-client-ssa-reproducer
The
csaupgrade.UpgradeManagedFieldsutility is meant to upgrade existing resources from using client-side apply to server-side apply by modifying the managed fields so that "Update" entries of the manager that did CSA are updated to "Apply" using a new manager.This transformation is done only in memory and is meant to be persisted to the server by the client. Using neither
client.Update(ctx, upgradedObj)norclient.Patch(ctx, origObj, client.MergeFrom(upgradedObj))works correctly and the object ends up with an "Update" record in the managed fields instead of the expected "Apply".I put together a simple reproducer for the bug:
https://github.com/metlos/fake-client-ssa-reproducer