Commit Graph
4 Commits
Author SHA1 Message Date
rosstimothy bde53bc267 Clean up cache collections (#54499)
The store now takes a clone function and uses it to clone all
resources within calls to put. This ensures that there are no races
caused by any modifications of the resource by the event stream.
This also allowed the clone function to be removed from the
genericGetter and genericLister as they can now leverage the store
clone function.

All header transforms now populate the kind and version based on
the information in the ResourceHeader instead of hardcoding the
currently known values.

All indexes derived from the resource name are specified
using `Resource.GetName` instead of defining a function in line
that called r.GetName(). The one caveat being this only works
for types that are behind an interface and none of the RFD 153
style resources.

The clone function of all non-gogo proto resources were switched
from utils.CloneProtoMsg to proto.CloneOf. The clone utility is
only required to prevent panics when cloning gogo proto resources.

All remaining local resource caches have been removed.

All unused legacy executors have been removed.
2025-05-13 16:37:21 +00:00
rosstimothy 35bd0b3d0c Convert zero trust access related resources to new in memory cache collection (#54494)
* Convert dynamic windows desktops

* Convert kube waiting containers

* Convert git servers

* Convert database objects

* fix: remove unused field
2025-05-08 14:41:23 +00:00
rosstimothy 38481aa6ee Make sort cache indexes type safe (#54395)
A new type constraint was added to the sort cache to make indexes
type safe. The types are limited to `comparable` so the indexes can
be used as map keys internally. The primary motivation for the
change is to leverage the compiler to prevent using indexes which
are not valid for a given cache.

While it's still technically possible to use a string literal as
the index if the type index is constrained to `~string` it should
be avoided to ensure the compiler can catch invalid indexes.
2025-05-01 17:50:12 +00:00
rosstimothy 9b7707c7f8 Convert cache list resources implementation to store items in memory (#53355)
Moves all resources types supported by ListResources to the new cache
collection scheme that was introduced in #52210. No additional
functionality changes have been made here. This should be a purely
mechanical translation to the new internal caching machinery.
2025-04-28 19:01:22 +00:00