Skip to content

Fake client: ManagedFields modified using csaupgrade.UpgradeManagedFields are not persisted correctly #3484

@metlos

Description

@metlos

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions