Closed scothis closed 11 months ago
Patch coverage: 39.24%
and project coverage change: -0.74%
:warning:
Comparison is base (
4dff503
) 61.36% compared to head (d3cd0cc
) 60.62%.:exclamation: Current head d3cd0cc differs from pull request most recent head 7256938. Consider uploading reports for the commit 7256938 to get more accurate results
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
The clients used by reconciler runtime are now able to interact with duck typed resources, with some limitations. The support extends to working inside reconcilers, including with the ResourceReconciler.
Duck typed resources are structured types that implement the client.Object interface but are not registered in the scheme for a GVK. The APIVersion and Kind fields must be set on the object.
Using ResourceReconciler with a duck type is similar to using an unstructured type and then casting to the duck type, however, starting with a duck type will allow the resource to participate in common structured operations like setting the status observed generation, initializing conditions, and coalescing condition timestamps when the condition did not otherwise change.
Known limitations include:
To help solve the ephemeral nature of time, this change also introduces a mechanism to retrieve the current time off the context via rtime.RetrieveNow. Each root reconciler stashes the current time. Additionally, each test case can define the Now field with a custom timestamp that is stashed as the current time.
The condition manager Manage method is deprecated in favor of ManageWithContext, which will use the stashed time when constructing conditions. The status InitializeConditions method should be updated to accept a context when it is defined, the no arg variant is deprecated. When using either deprecated method without a context, time.Now is used instead of the stashed time.
Resolves #53