grpcsource

package
v0.0.0-...-b340060 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2024 License: Apache-2.0 Imports: 32 Imported by: 0

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

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 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

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 (*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

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

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