Skip to content

mergeFromPatch does not consider the zero value as part of the patch  #703

Closed
@enxebre

Description

@enxebre

A CRD has a status sub-resource with a required integer field: status.IntField
When trying to patch the status for the first time with status.IntField=0 the diff given by patch.Data(obj) does not consider the zero value as part of the patch to be applied and the request via mergeFromPatch client.Status().Patch fails with is invalid: status.IntField: Required value
Is the only way to go to make IntField a pointer?

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.priority/backlogHigher priority than priority/awaiting-more-evidence.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions