Skip to content

CreateOrUpdate falsely claiming its updating resources  #847

Closed
@mcristina422

Description

@mcristina422

While using CreateOrUpdate with resources that get defaulted it can return OperationResultUpdated despite there being no updates. I'm not concerned that the call to Update is happening, the same values get defaulted. But I think returning OperationResultUpdated is wrong since nothing was actually updated. I think that OperationResultUpdated should only be returned when the ResourceVersion is not equal to the original.
https://github.com/kubernetes-sigs/controller-runtime/compare/master...mcristina422:cmpResourseVersion?expand=1#diff-4c146d38c03cf55e321de9ad53af4452R220-R238

I originally came across this issue setting ports on Service similar to #464 (comment)

I recreated the issue in a Deployment with my proposed fix in https://github.com/kubernetes-sigs/controller-runtime/compare/master...mcristina422:cmpResourseVersion?expand=1

@DirectXMan12 do you think my proposal makes sense

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.priority/awaiting-more-evidenceLowest priority. Possibly useful, but not yet enough support to actually get it done.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions