Skip to content

Initial status subresource is not saved when using client.Create #1835

@jsravn

Description

@jsravn

I am following the example in https://book.kubebuilder.io/cronjob-tutorial/writing-tests.html, where it creates a Job with a status and calls client.Create. I'm doing similar with a third party CRD (tekton's PipelineRun) with a status subresource - however, in my testing, the status field isn't saved. The only way I can get it to save the status is first create the CRD, then retrieve the created CRD, and finally call client.Status().Update. Calling client.Status().Update on the initial struct I create doesn't work either (expected, I suppose, since it doesn't have a uuid?) - but no error is returned, so it seems like it worked.

In summary:

  1. Is client.Create supposed to update the status as well?
  2. Should client.Status().Update return an error if it fails to update the status?

Metadata

Metadata

Assignees

No one assigned

    Labels

    lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions