Documentation
¶
Index ¶
- Variables
- func NewMaestroGRPCSourceWorkClient(ctx context.Context, apiClient *openapi.APIClient, opts *grpc.GRPCOptions, ...) (workv1client.WorkV1Interface, error)
- func ToLabelSearch(opts metav1.ListOptions) (labels.Selector, string, bool, error)
- func ToManifestWork(rb *openapi.ResourceBundle) (*workv1.ManifestWork, error)
- func ToWorkPatch(existingWork, newWork *workv1.ManifestWork) ([]byte, error)
- type RESTFulAPIWatcherStore
- func (m *RESTFulAPIWatcherStore) Add(work *workv1.ManifestWork) error
- func (m *RESTFulAPIWatcherStore) Delete(work *workv1.ManifestWork) error
- func (m *RESTFulAPIWatcherStore) Get(namespace, name string) (*workv1.ManifestWork, bool, error)
- func (m *RESTFulAPIWatcherStore) GetWatcher(namespace string, opts metav1.ListOptions) (watch.Interface, error)
- func (m *RESTFulAPIWatcherStore) HandleReceivedWork(action types.ResourceAction, work *workv1.ManifestWork) error
- func (m *RESTFulAPIWatcherStore) HasInitiated() bool
- func (m *RESTFulAPIWatcherStore) List(namespace string, opts metav1.ListOptions) (*workv1.ManifestWorkList, error)
- func (m *RESTFulAPIWatcherStore) ListAll() ([]*workv1.ManifestWork, error)
- func (m *RESTFulAPIWatcherStore) Sync() error
- func (m *RESTFulAPIWatcherStore) Update(work *workv1.ManifestWork) error
- type WorkV1ClientWrapper
Constants ¶
This section is empty.
Variables ¶
var MaxListPageSize int32 = 400
MaxListPageSize is the maximum size of one page, default is 400. NOTE: This should be reset carefully, when increasing this value, both maestro server's memory limit and the page size of resources need to be considered, if a bigger value is used, it might lead to maestro server OOM.
Functions ¶
func NewMaestroGRPCSourceWorkClient ¶
func NewMaestroGRPCSourceWorkClient( ctx context.Context, apiClient *openapi.APIClient, opts *grpc.GRPCOptions, sourceID string, ) (workv1client.WorkV1Interface, error)
func ToLabelSearch ¶
func ToManifestWork ¶
func ToManifestWork(rb *openapi.ResourceBundle) (*workv1.ManifestWork, error)
ToManifestWork converts an openapi.ResourceBundle object to workv1.ManifestWork object
func ToWorkPatch ¶
func ToWorkPatch(existingWork, newWork *workv1.ManifestWork) ([]byte, error)
ToWorkPatch returns a merge patch between an existing work and a new work. The patch will keep the resource version of an existing work, and only patch a work of labels, annotations, finalizers, owner references and spec.
Types ¶
type RESTFulAPIWatcherStore ¶
RESTFulAPIWatcherStore implements the WorkClientWatcherStore interface, it is used to build a source work client. The work client uses this store to
- get/list works from Maestro server via RESTfull APIs
- receive the work status update and send the updated work to the watch channel
func (*RESTFulAPIWatcherStore) Add ¶
func (m *RESTFulAPIWatcherStore) Add(work *workv1.ManifestWork) error
func (*RESTFulAPIWatcherStore) Delete ¶
func (m *RESTFulAPIWatcherStore) Delete(work *workv1.ManifestWork) error
func (*RESTFulAPIWatcherStore) Get ¶
func (m *RESTFulAPIWatcherStore) Get(namespace, name string) (*workv1.ManifestWork, bool, error)
Get a work from maestro server with its namespace and name
func (*RESTFulAPIWatcherStore) GetWatcher ¶
func (m *RESTFulAPIWatcherStore) GetWatcher(namespace string, opts metav1.ListOptions) (watch.Interface, error)
GetWatcher returns a watcher to the source work client with a specified namespace (consumer name). Using `metav1.NamespaceAll` to specify all namespaces.
func (*RESTFulAPIWatcherStore) HandleReceivedWork ¶
func (m *RESTFulAPIWatcherStore) HandleReceivedWork(action types.ResourceAction, work *workv1.ManifestWork) error
HandleReceivedWork sends the received works to the watch channel
func (*RESTFulAPIWatcherStore) HasInitiated ¶
func (m *RESTFulAPIWatcherStore) HasInitiated() bool
func (*RESTFulAPIWatcherStore) List ¶
func (m *RESTFulAPIWatcherStore) List(namespace string, opts metav1.ListOptions) (*workv1.ManifestWorkList, error)
List works from maestro server with a specified namespace and list options. Using `metav1.NamespaceAll` to specify all namespace.
func (*RESTFulAPIWatcherStore) ListAll ¶
func (m *RESTFulAPIWatcherStore) ListAll() ([]*workv1.ManifestWork, error)
func (*RESTFulAPIWatcherStore) Sync ¶
func (m *RESTFulAPIWatcherStore) Sync() error
func (*RESTFulAPIWatcherStore) Update ¶
func (m *RESTFulAPIWatcherStore) Update(work *workv1.ManifestWork) error
type WorkV1ClientWrapper ¶
type WorkV1ClientWrapper struct {
ManifestWorkClient *sourceclient.ManifestWorkSourceClient
}
WorkV1ClientWrapper wraps a ManifestWork client to a WorkV1Interface
func (*WorkV1ClientWrapper) AppliedManifestWorks ¶
func (c *WorkV1ClientWrapper) AppliedManifestWorks() workv1client.AppliedManifestWorkInterface
func (*WorkV1ClientWrapper) ManifestWorks ¶
func (c *WorkV1ClientWrapper) ManifestWorks(namespace string) workv1client.ManifestWorkInterface
func (*WorkV1ClientWrapper) RESTClient ¶
func (c *WorkV1ClientWrapper) RESTClient() rest.Interface