Skip to content

The fake client Update() should not store omit empty fields #2477

@berlin-ab

Description

@berlin-ab

The update deserializes the json from the old object into the new object, but if the old object didn't have the json keys to override the new object, the new object keeps its values:

The relevant code is here:

https://github.com/kubernetes-sigs/controller-runtime/blob/main/pkg/client/fake/client.go#L1025

See #2476 for a test case that points out the bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.kind/supportCategorizes issue or PR as a support question.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions