Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ForceListOnly ¶ added in v0.10.10
func ForceListOnly(gvk schema2.GroupVersionKind)
ForceListOnly makes the cluster cache treat gvk as list-only (no server-side watch), so it is cached by periodically re-listing instead of watching. It is primarily a testing hook; see the package comment above.
func UnforceListOnly ¶ added in v0.10.10
func UnforceListOnly(gvk schema2.GroupVersionKind)
UnforceListOnly undoes a previous ForceListOnly for gvk. Tests typically call it via defer so the override can't leak into other tests.
Types ¶
type ChangeHandler ¶
type ClusterCache ¶
type ClusterCache interface {
Get(gvk schema2.GroupVersionKind, namespace, name string) (interface{}, bool, error)
List(gvk schema2.GroupVersionKind) []interface{}
OnAdd(ctx context.Context, handler Handler)
OnRemove(ctx context.Context, handler Handler)
OnChange(ctx context.Context, handler ChangeHandler)
OnSchemas(schemas *schema.Collection) error
}
func NewClusterCache ¶
func NewClusterCache(ctx context.Context, dynamicClient dynamic.Interface) ClusterCache