Closed
Description
Problem
When using a fakeClient
returned via fake.NewClientBuilder().Build()
as a parameter to NewDryRunClient()
I noticed that calls to the resulting dryRunClient
's Delete()
still deleted the resources instead of honoring the metav1.DryRunAll
option.
A brief example of what my setup looks like:
fakeClient := fake.NewClientBuilder().Build()
dryRunClient := client.NewDryRunClient(fakeClient)
// This still deletes the objects passed in
dryRunClient.Delete(ctx, object)
This lead me to take a look at the source code for the fakeClient
CRUD functions. I noticed that this snippet (or ones similar to it):
for _, dryRunOpt := range createOptions.DryRun {
if dryRunOpt == metav1.DryRunAll {
return nil
}
}
are present in the following functions:
Proposed Solution
I am proposing that code is added to the fakeClient
Delete()
and DeleteAllOf()
functions similar to the ones that exist in the above mentioned functions.
I am happy to take on the development work for this if the proposed solution is accepted.
Metadata
Metadata
Assignees
Labels
No labels