Skip to content

The fake client.Update() updates the status fields #2478

Closed
@ahmetb

Description

@ahmetb

I'm observing that using the non-subresource fake.Client on both in-tree types (like corev1.Node or corev1.Pod) as well as Custom Resources actually save modifications on status fields to the resource (and are reflected on subsequent Get calls).

A minimal repro: https://gist.github.com/ahmetb/50784526a54244d45022a7ed8d556a62
This is the case even if I do fake.NewClientBuilder().WithStatusSubresource(&corev1.Pod{})

Expected behavior is to be the same as a non-fake client where if you modify a status field and use client.Update(ctx, obj) the modifications on the status field are discarded.

/kind bug

Metadata

Metadata

Assignees

Labels

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

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions