Documentation ¶
Index ¶
- Constants
- func WaitForStoreInit(ctx context.Context, cacheSyncs ...StoreInitiated) bool
- type AgentInformerWatcherStore
- func (s *AgentInformerWatcherStore) Add(work *workv1.ManifestWork) error
- func (s *AgentInformerWatcherStore) Delete(work *workv1.ManifestWork) error
- func (b *AgentInformerWatcherStore) Get(namespace, name string) (*workv1.ManifestWork, bool, error)
- func (s *AgentInformerWatcherStore) GetWatcher(namespace string, opts metav1.ListOptions) (watch.Interface, error)
- func (s *AgentInformerWatcherStore) HandleReceivedWork(action types.ResourceAction, work *workv1.ManifestWork) error
- func (s *AgentInformerWatcherStore) HasInitiated() bool
- func (b *AgentInformerWatcherStore) List(namespace string, opts metav1.ListOptions) (*workv1.ManifestWorkList, error)
- func (b *AgentInformerWatcherStore) ListAll() ([]*workv1.ManifestWork, error)
- func (s *AgentInformerWatcherStore) SetStore(store cache.Store)
- func (s *AgentInformerWatcherStore) Update(work *workv1.ManifestWork) error
- type ListLocalWorksFunc
- type SourceInformerWatcherStore
- func (s *SourceInformerWatcherStore) Add(work *workv1.ManifestWork) error
- func (s *SourceInformerWatcherStore) Delete(work *workv1.ManifestWork) error
- func (s *SourceInformerWatcherStore) GetWatcher(namespace string, opts metav1.ListOptions) (watch.Interface, error)
- func (bs *SourceInformerWatcherStore) HandleReceivedWork(action types.ResourceAction, work *workv1.ManifestWork) error
- func (s *SourceInformerWatcherStore) HasInitiated() bool
- func (s *SourceInformerWatcherStore) SetStore(store cache.Store)
- func (s *SourceInformerWatcherStore) Update(work *workv1.ManifestWork) error
- type SourceLocalWatcherStore
- func (s *SourceLocalWatcherStore) Add(work *workv1.ManifestWork) error
- func (s *SourceLocalWatcherStore) Delete(work *workv1.ManifestWork) error
- func (s *SourceLocalWatcherStore) GetWatcher(namespace string, opts metav1.ListOptions) (watch.Interface, error)
- func (bs *SourceLocalWatcherStore) HandleReceivedWork(action types.ResourceAction, work *workv1.ManifestWork) error
- func (s *SourceLocalWatcherStore) HasInitiated() bool
- func (s *SourceLocalWatcherStore) Update(work *workv1.ManifestWork) error
- type StoreInitiated
- type WorkClientWatcherStore
Constants ¶
const ManifestWorkFinalizer = "cloudevents.open-cluster-management.io/manifest-work-cleanup"
Variables ¶
This section is empty.
Functions ¶
func WaitForStoreInit ¶
func WaitForStoreInit(ctx context.Context, cacheSyncs ...StoreInitiated) bool
Types ¶
type AgentInformerWatcherStore ¶
type AgentInformerWatcherStore struct {
// contains filtered or unexported fields
}
AgentInformerWatcherStore extends the baseStore. It gets/lists the works from the given informer store and send the work add/update/delete event to the watch channel directly.
It is used for building ManifestWork agent client.
func NewAgentInformerWatcherStore ¶
func NewAgentInformerWatcherStore() *AgentInformerWatcherStore
func (*AgentInformerWatcherStore) Add ¶
func (s *AgentInformerWatcherStore) Add(work *workv1.ManifestWork) error
func (*AgentInformerWatcherStore) Delete ¶
func (s *AgentInformerWatcherStore) Delete(work *workv1.ManifestWork) error
func (*AgentInformerWatcherStore) Get ¶
func (b *AgentInformerWatcherStore) Get(namespace, name string) (*workv1.ManifestWork, bool, error)
Get a works from the store
func (*AgentInformerWatcherStore) GetWatcher ¶
func (s *AgentInformerWatcherStore) GetWatcher(namespace string, opts metav1.ListOptions) (watch.Interface, error)
func (*AgentInformerWatcherStore) HandleReceivedWork ¶
func (s *AgentInformerWatcherStore) HandleReceivedWork(action types.ResourceAction, work *workv1.ManifestWork) error
func (*AgentInformerWatcherStore) HasInitiated ¶
func (s *AgentInformerWatcherStore) HasInitiated() bool
func (*AgentInformerWatcherStore) List ¶
func (b *AgentInformerWatcherStore) List(namespace string, opts metav1.ListOptions) (*workv1.ManifestWorkList, error)
List the works from the store with the list options
func (*AgentInformerWatcherStore) ListAll ¶
func (b *AgentInformerWatcherStore) ListAll() ([]*workv1.ManifestWork, error)
List all of works from the store
func (*AgentInformerWatcherStore) SetStore ¶
func (s *AgentInformerWatcherStore) SetStore(store cache.Store)
func (*AgentInformerWatcherStore) Update ¶
func (s *AgentInformerWatcherStore) Update(work *workv1.ManifestWork) error
type ListLocalWorksFunc ¶
type ListLocalWorksFunc func(ctx context.Context) ([]*workv1.ManifestWork, error)
ListLocalWorksFunc loads the works from the local environment.
type SourceInformerWatcherStore ¶
type SourceInformerWatcherStore struct {
// contains filtered or unexported fields
}
SourceInformerWatcherStore extends the baseStore. It gets/lists the works from the given informer store and send the work add/update/delete event to the watch channel directly.
It is used for building ManifestWork source client.
func NewSourceInformerWatcherStore ¶
func NewSourceInformerWatcherStore(ctx context.Context) *SourceInformerWatcherStore
func (*SourceInformerWatcherStore) Add ¶
func (s *SourceInformerWatcherStore) Add(work *workv1.ManifestWork) error
func (*SourceInformerWatcherStore) Delete ¶
func (s *SourceInformerWatcherStore) Delete(work *workv1.ManifestWork) error
func (*SourceInformerWatcherStore) GetWatcher ¶
func (s *SourceInformerWatcherStore) GetWatcher(namespace string, opts metav1.ListOptions) (watch.Interface, error)
func (*SourceInformerWatcherStore) HandleReceivedWork ¶
func (bs *SourceInformerWatcherStore) HandleReceivedWork(action types.ResourceAction, work *workv1.ManifestWork) error
func (*SourceInformerWatcherStore) HasInitiated ¶
func (s *SourceInformerWatcherStore) HasInitiated() bool
func (*SourceInformerWatcherStore) SetStore ¶
func (s *SourceInformerWatcherStore) SetStore(store cache.Store)
func (*SourceInformerWatcherStore) Update ¶
func (s *SourceInformerWatcherStore) Update(work *workv1.ManifestWork) error
type SourceLocalWatcherStore ¶
type SourceLocalWatcherStore struct {
// contains filtered or unexported fields
}
SourceLocalWatcherStore caches the works in this local store and provide the watch ability by watch event channel.
It is used for building ManifestWork source client.
func NewSourceLocalWatcherStore ¶
func NewSourceLocalWatcherStore(ctx context.Context, listFunc ListLocalWorksFunc) (*SourceLocalWatcherStore, error)
NewSourceLocalWatcherStore returns a LocalWatcherStore with works that list by ListLocalWorksFunc
func (*SourceLocalWatcherStore) Add ¶
func (s *SourceLocalWatcherStore) Add(work *workv1.ManifestWork) error
Add a work to the cache and send an event to the event queue
func (*SourceLocalWatcherStore) Delete ¶
func (s *SourceLocalWatcherStore) Delete(work *workv1.ManifestWork) error
Delete a work from the cache and send an event to the event queue
func (*SourceLocalWatcherStore) GetWatcher ¶
func (s *SourceLocalWatcherStore) GetWatcher(namespace string, opts metav1.ListOptions) (watch.Interface, error)
func (*SourceLocalWatcherStore) HandleReceivedWork ¶
func (bs *SourceLocalWatcherStore) HandleReceivedWork(action types.ResourceAction, work *workv1.ManifestWork) error
func (*SourceLocalWatcherStore) HasInitiated ¶
func (s *SourceLocalWatcherStore) HasInitiated() bool
func (*SourceLocalWatcherStore) Update ¶
func (s *SourceLocalWatcherStore) Update(work *workv1.ManifestWork) error
Update a work in the cache and send an event to the event queue
type StoreInitiated ¶
type StoreInitiated func() bool
StoreInitiated is a function that can be used to determine if a store has initiated.
type WorkClientWatcherStore ¶
type WorkClientWatcherStore interface { // GetWatcher returns a watcher to receive work changes. GetWatcher(namespace string, opts metav1.ListOptions) (watch.Interface, error) // HandleReceivedWork handles the client received work events. HandleReceivedWork(action types.ResourceAction, work *workv1.ManifestWork) error // Add will be called by work client when adding works. The implementation is based on the specific // watcher store, in some case, it does not need to update a store, but just send a watch event. Add(work *workv1.ManifestWork) error // Update will be called by work client when updating works. The implementation is based on the specific // watcher store, in some case, it does not need to update a store, but just send a watch event. Update(work *workv1.ManifestWork) error // Delete will be called by work client when deleting works. The implementation is based on the specific // watcher store, in some case, it does not need to update a store, but just send a watch event. Delete(work *workv1.ManifestWork) error // List returns the works from store for a given namespace with list options List(namespace string, opts metav1.ListOptions) (*workv1.ManifestWorkList, error) // ListAll list all of the works from store ListAll() ([]*workv1.ManifestWork, error) // Get returns a work from store with work namespace and name Get(namespace, name string) (*workv1.ManifestWork, bool, error) // HasInitiated marks the store has been initiated, A resync may be required after the store is initiated // when building a work client. HasInitiated() bool }
WorkClientWatcherStore provides a watcher with a work store.