dotnet-operator-sdk
dotnet-operator-sdk copied to clipboard
Investigate the item cache
Investigate the possibility to remove the item cache with "resourceVersion" and "generation"
@stebenz I know what you meant by the resourceVersion / observed version and generation. (https://stackoverflow.com/questions/47100389/what-is-the-difference-between-a-resourceversion-and-a-generation/47101418)
Right now, the item cache is needed to determine if changes on the entities are only in the status part or in the spec part of a resource. I need to investigate further if there is any chance to detect such changes without caching all items. (However, caching the items does not use that much memory - at least at the time being)
I would want to possibly benchmark the performance/reliability of the method, but how about storing the output of GetHashCode
for both the object and the status sub-resource. I know at least with System.Text.Json, you can call that on its value-typed JsonElement and JsonDocument for consistent results... not sure about Newtonsoft.Json
Hmm good call... Depending on the outcome of the discussion about created/updated, maybe the cache is not needed anymore. Or at least only with the items you just said.
I think the cache would still be needed in some capacity as the SDK still would need some way to compare to determine Modified
vs StatusModified