registry

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetWorkloadList

func GetWorkloadList(ctx context.Context, c client.Client, store Store, namespace string, match rolloutv1alpha1.ResourceMatch) ([]workload.Interface, error)

GetWorkloadList implements WorkloadManager.

Types

type Registry

type Registry interface {
	// SetupWithManger initialize registry with manager.
	SetupWithManger(mgr manager.Manager)
	// Register add a new workload store for given gvk
	Register(store Store)
	// Delete delete a new workload store for given gvk
	Delete(gvk schema.GroupVersionKind)
	// If the gvk is registered and supported by all member clusters, Get returns the workload rest store.
	Get(gvk schema.GroupVersionKind) (Store, error)
	// WatchableStores return all watchable and supported stores.
	WatchableStores() []Store
}

func New

func New() Registry

type Store

type Store interface {
	GroupVersionKind() schema.GroupVersionKind
	// NewObject returns a new instance of the workload type
	NewObject() client.Object
	// NewObjectList returns a new instance of the workload list type
	NewObjectList() client.ObjectList
	// Watchable indicates whether this workload type can be watched from the API server.
	Watchable() bool
	// Wrap get a client.Object and returns a workload interface
	Wrap(cluster string, obj client.Object) (workload.Interface, error)
	// Get returns a wrapped workload interface
	Get(ctx context.Context, cluster, namespace, name string) (workload.Interface, error)
	// GetWorkloadList finds workload by match
	List(ctx context.Context, namespace string, match rolloutv1alpha1.ResourceMatch) ([]workload.Interface, error)
}

Standard workload store interface

Jump to

Keyboard shortcuts

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