Skip to content

Commit 82ab59f

Browse files
committed
add a known limitations section to fake.Client
- remove the deprecation warning as per issue #768 - minor typo fixes
1 parent add0b64 commit 82ab59f

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

pkg/client/fake/doc.go

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,24 @@ limitations under the License.
1717
/*
1818
Package fake provides a fake client for testing.
1919
20-
Deprecated: please use pkg/envtest for testing. This package will be dropped
21-
before the v1.0.0 release.
22-
23-
An fake client is backed by its simple object store indexed by GroupVersionResource.
20+
fake client is backed by its simple object store indexed by GroupVersionResource.
2421
You can create a fake client with optional objects.
2522
2623
client := NewFakeClient(initObjs...) // initObjs is a slice of runtime.Object
2724
2825
You can invoke the methods defined in the Client interface.
2926
30-
When it doubt, it's almost always better not to use this package and instead use
27+
When in doubt, it's almost always better not to use this package and instead use
3128
envtest.Environment with a real client and API server.
29+
30+
Current Limitations / Known Issues with the fake Client:
31+
- this client does not use reactors so it can not be setup with detailed responses for testing
32+
- possible locking issues when using fake client and not the actual client
33+
- by default you are using the wrong scheme
34+
- there is no support for sub resources which can cause issues with tests if you're trying to update
35+
e.g. metadata and status in the same reconcile
36+
- There is also no OpenAPI validation
37+
- It does not bump `Generation` or `ResourceVersion` so Patch/Update will not behave properly
38+
3239
*/
3340
package fake

0 commit comments

Comments
 (0)