Documentation ¶
Overview ¶
Package forwardingregistry provides a CRD-like REST storage implementation that can dynamically serve resources based on a given OpenAPI schema, and forward the requests to a KCP workspace-aware delegate client.
It reuses as much as possible from k8s.io/apiextensions-apiserver/pkg/registry/customresource, but replaces the underlying Store, using forwarding rather than access to etcd via genericregistry.Store.
Index ¶
- type CategoriesProviderFunc
- type CollectionDeleterFunc
- type CreaterFunc
- type DestroyerFunc
- type FactoryFunc
- type GetterFunc
- type GracefulDeleterFunc
- type ListFactoryFunc
- type ListerFunc
- type ResetFieldsStrategyFunc
- type StorageWrapper
- type StoreFuncs
- type Strategy
- type TableConvertorFunc
- type UpdaterFunc
- type WatcherFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CategoriesProviderFunc ¶
type CategoriesProviderFunc func() []string
func (CategoriesProviderFunc) Categories ¶
func (f CategoriesProviderFunc) Categories() []string
type CollectionDeleterFunc ¶
type CollectionDeleterFunc func(ctx context.Context, deleteValidation rest.ValidateObjectFunc, options *metav1.DeleteOptions, listOptions *metainternalversion.ListOptions) (runtime.Object, error)
func (CollectionDeleterFunc) DeleteCollection ¶
func (f CollectionDeleterFunc) DeleteCollection(ctx context.Context, deleteValidation rest.ValidateObjectFunc, options *metav1.DeleteOptions, listOptions *metainternalversion.ListOptions) (runtime.Object, error)
type CreaterFunc ¶
type CreaterFunc func(ctx context.Context, obj runtime.Object, createValidation rest.ValidateObjectFunc, options *metav1.CreateOptions) (runtime.Object, error)
func (CreaterFunc) Create ¶
func (f CreaterFunc) Create(ctx context.Context, obj runtime.Object, createValidation rest.ValidateObjectFunc, options *metav1.CreateOptions) (runtime.Object, error)
type DestroyerFunc ¶
type DestroyerFunc func()
func (DestroyerFunc) Destroy ¶
func (f DestroyerFunc) Destroy()
type FactoryFunc ¶
func (FactoryFunc) New ¶
func (f FactoryFunc) New() runtime.Object
type GetterFunc ¶
type GracefulDeleterFunc ¶
type GracefulDeleterFunc func(ctx context.Context, name string, deleteValidation rest.ValidateObjectFunc, options *metav1.DeleteOptions) (runtime.Object, bool, error)
func (GracefulDeleterFunc) Delete ¶
func (f GracefulDeleterFunc) Delete(ctx context.Context, name string, deleteValidation rest.ValidateObjectFunc, options *metav1.DeleteOptions) (runtime.Object, bool, error)
type ListFactoryFunc ¶
func (ListFactoryFunc) NewList ¶
func (f ListFactoryFunc) NewList() runtime.Object
type ListerFunc ¶
type ListerFunc func(ctx context.Context, options *metainternalversion.ListOptions) (runtime.Object, error)
func (ListerFunc) List ¶
func (f ListerFunc) List(ctx context.Context, options *metainternalversion.ListOptions) (runtime.Object, error)
type ResetFieldsStrategyFunc ¶
type ResetFieldsStrategyFunc func() map[fieldpath.APIVersion]*fieldpath.Set
func (ResetFieldsStrategyFunc) GetResetFields ¶
func (f ResetFieldsStrategyFunc) GetResetFields() map[fieldpath.APIVersion]*fieldpath.Set
type StorageWrapper ¶
type StorageWrapper func(schema.GroupResource, *StoreFuncs) *StoreFuncs
StorageWrapper allows consumers to wrap the delegating Store in order to add custom behavior around it. For example, a consumer might want to filter the results from the delegated Store, or add impersonation to it.
func WithLabelSelector ¶
func WithLabelSelector(labelSelectorFrom func(ctx context.Context) labels.Requirements) StorageWrapper
func WithStaticLabelSelector ¶
func WithStaticLabelSelector(labelSelector labels.Requirements) StorageWrapper
type StoreFuncs ¶
type StoreFuncs struct { FactoryFunc ListFactoryFunc DestroyerFunc GetterFunc CreaterFunc GracefulDeleterFunc CollectionDeleterFunc ListerFunc UpdaterFunc WatcherFunc TableConvertorFunc CategoriesProviderFunc ResetFieldsStrategyFunc }
StoreFuncs holds proto-functions that can be mutated by successive actors to wrap behavior. Ultimately you can pick and choose which functions to expose in the end, depending on how much of REST storage you need.
func DefaultDynamicDelegatedStoreFuncs ¶
func DefaultDynamicDelegatedStoreFuncs( factory FactoryFunc, listFactory ListFactoryFunc, destroyerFunc DestroyerFunc, strategy Strategy, tableConvertor rest.TableConvertor, resource schema.GroupVersionResource, apiExportIdentityHash string, categories []string, dynamicClusterClient dynamic.ClusterInterface, subResources []string, patchConflictRetryBackoff wait.Backoff, stopWatchesCh <-chan struct{}, ) *StoreFuncs
func NewStorage ¶
func NewStorage(ctx context.Context, resource schema.GroupVersionResource, apiExportIdentityHash string, kind, listKind schema.GroupVersionKind, strategy customresource.CustomResourceStrategy, categories []string, tableConvertor rest.TableConvertor, replicasPathMapping fieldmanager.ResourcePathMappings, dynamicClusterClient dynamic.ClusterInterface, patchConflictRetryBackoff *wait.Backoff, wrapper StorageWrapper) (mainStorage, statusStorage *StoreFuncs)
NewStorage returns a REST storage that forwards calls to a dynamic client
type Strategy ¶
type Strategy interface { rest.RESTCreateStrategy rest.ResetFieldsStrategy }
type TableConvertorFunc ¶
type UpdaterFunc ¶
type UpdaterFunc func(ctx context.Context, name string, objInfo rest.UpdatedObjectInfo, createValidation rest.ValidateObjectFunc, updateValidation rest.ValidateObjectUpdateFunc, forceAllowCreate bool, options *metav1.UpdateOptions) (runtime.Object, bool, error)
func (UpdaterFunc) Update ¶
func (f UpdaterFunc) Update(ctx context.Context, name string, objInfo rest.UpdatedObjectInfo, createValidation rest.ValidateObjectFunc, updateValidation rest.ValidateObjectUpdateFunc, forceAllowCreate bool, options *metav1.UpdateOptions) (runtime.Object, bool, error)
type WatcherFunc ¶
type WatcherFunc func(ctx context.Context, options *metainternalversion.ListOptions) (watch.Interface, error)
func (WatcherFunc) Watch ¶
func (f WatcherFunc) Watch(ctx context.Context, options *metainternalversion.ListOptions) (watch.Interface, error)