grpcsource

package
v0.0.0-...-3717fc6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 21, 2026 License: Apache-2.0 Imports: 33 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
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,
	logger logging.Logger,
	apiClient *openapi.APIClient,
	opts *grpc.GRPCOptions,
	sourceID string,
) (workv1client.WorkV1Interface, error)

func PageList

func PageList(ctx context.Context, logger logging.Logger, client *openapi.APIClient, search string, opts metav1.ListOptions) (*openapi.ResourceBundleList, string, error)

PageList assists client code in breaking large list queries into multiple smaller chunks of PageSize or smaller.

func ResetsourceClientRegisteredWatchersGaugeMetric

func ResetsourceClientRegisteredWatchersGaugeMetric()

func ToLabelSearch

func ToLabelSearch(opts metav1.ListOptions) (labels.Selector, string, bool, error)

func ToManifestWork

func ToManifestWork(rb *openapi.ResourceBundle) (*workv1.ManifestWork, error)

ToManifestWork converts an openapi.ResourceBundle object to workv1.ManifestWork object

func ToSyncSearch

func ToSyncSearch(sourceID string, namespaces []string) string

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 generation of an existing work, and only patch a work of labels, annotations, finalizers, owner references and spec.

Types

type RESTFulAPIWatcherStore

type RESTFulAPIWatcherStore struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

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 (*RESTFulAPIWatcherStore) Delete

func (m *RESTFulAPIWatcherStore) Delete(work runtime.Object) error

func (*RESTFulAPIWatcherStore) Get

func (m *RESTFulAPIWatcherStore) Get(ctx context.Context, 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(ctx context.Context, 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) HandleReceivedResource

func (m *RESTFulAPIWatcherStore) HandleReceivedResource(ctx context.Context, work *workv1.ManifestWork) error

HandleReceivedWork sends the received works to the watch channel

func (*RESTFulAPIWatcherStore) HasInitiated

func (m *RESTFulAPIWatcherStore) HasInitiated() bool

func (*RESTFulAPIWatcherStore) List

List works from maestro server with a specified namespace and list options. Using `metav1.NamespaceAll` to specify all namespace.

func (*RESTFulAPIWatcherStore) ListAll

func (*RESTFulAPIWatcherStore) Sync

func (m *RESTFulAPIWatcherStore) Sync() error

func (*RESTFulAPIWatcherStore) Update

func (m *RESTFulAPIWatcherStore) Update(work runtime.Object) error

type WorkV1ClientWrapper

type WorkV1ClientWrapper struct {
	ManifestWorkClient *sourceclient.ManifestWorkSourceClient
}

WorkV1ClientWrapper wraps a ManifestWork client to a WorkV1Interface

func (*WorkV1ClientWrapper) AppliedManifestWorks

func (*WorkV1ClientWrapper) ManifestWorks

func (c *WorkV1ClientWrapper) ManifestWorks(namespace string) workv1client.ManifestWorkInterface

func (*WorkV1ClientWrapper) RESTClient

func (c *WorkV1ClientWrapper) RESTClient() rest.Interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL