-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Description
I think we should either implement dry-run or return errors instead of just nil if someone tryes to use dry-run with the fake client.
xref:
controller-runtime/pkg/client/fake/client.go
Line 913 in 9893d5b
| return nil |
Returning nil seems very misleading as that is very different than a real dry-run.
Independent of that the Apply func does not detect dry-run correctly today as fakeClient.patch only checks for patchOptions.DryRun, not for patchOptions.Raw.DryRun
I'm not entirely sure what the issue here is:
- that we don't check Raw (which could be something that we are also missing in other places), xref:
controller-runtime/pkg/client/fake/client.go
Line 911 in 9893d5b
for _, dryRunOpt := range patchOptions.DryRun { - that the field is only set in Raw but not top-level (which is probably specific to Apply), xref:
controller-runtime/pkg/client/fake/client.go
Line 858 in 9893d5b
patchOpts.Raw = applyOpts.AsPatchOptions()
Metadata
Metadata
Assignees
Labels
No labels