Documentation ¶
Overview ¶
Implementation of package orchestration engine The engine is independent of k8s runtime (k8s apiserver integration is in apiserver module)
Index ¶
- Constants
- func ExtractContextConfigMap(resources map[string]string) (*unstructured.Unstructured, error)
- func GeneratePatch(fileName string, oldV, newV string) (api.PatchSpec, error)
- func NewWatcherManager() *watcherManager
- type CaDEngine
- type EngineOption
- func WithBuiltinFunctionRuntime() EngineOption
- func WithCache(cache *cache.Cache) EngineOption
- func WithCredentialResolver(resolver repository.CredentialResolver) EngineOption
- func WithFunctionRuntime(runtime fn.FunctionRuntime) EngineOption
- func WithGRPCFunctionRuntime(address string) EngineOption
- func WithMetadataStore(metadataStore meta.MetadataStore) EngineOption
- func WithReferenceResolver(resolver ReferenceResolver) EngineOption
- func WithRunnerOptions(options fnruntime.RunnerOptions) EngineOption
- func WithRunnerOptionsResolver(fn func(namespace string) fnruntime.RunnerOptions) EngineOption
- func WithSimpleFunctionRuntime() EngineOption
- func WithUserInfoProvider(provider repository.UserInfoProvider) EngineOption
- func WithWatcherManager(watcherManager *watcherManager) EngineOption
- type EngineOptionFunc
- type Function
- type NodeToMapWriter
- type Object
- type ObjectWatcher
- type Package
- type PackageFetcher
- func (p *PackageFetcher) FetchResources(ctx context.Context, packageRef *api.PackageRevisionRef, namespace string) (*api.PackageRevisionResources, error)
- func (p *PackageFetcher) FetchRevision(ctx context.Context, packageRef *api.PackageRevisionRef, namespace string) (repository.PackageRevision, error)
- type PackageRevision
- type ReferenceResolver
- type RepositoryOpener
- type WatcherManager
Constants ¶
View Source
const (
OptimisticLockErrorMsg = "the object has been modified; please apply your changes to the latest version and try again"
)
Variables ¶
This section is empty.
Functions ¶
func ExtractContextConfigMap ¶
func ExtractContextConfigMap(resources map[string]string) (*unstructured.Unstructured, error)
ExtractContextConfigMap returns the package-context configmap, if found
func GeneratePatch ¶
GeneratePatch returns patch operations for transforming from oldV to newV.
func NewWatcherManager ¶
func NewWatcherManager() *watcherManager
Types ¶
type CaDEngine ¶
type CaDEngine interface { // ObjectCache() is a cache of all our objects. ObjectCache() WatcherManager UpdatePackageResources(ctx context.Context, repositoryObj *configapi.Repository, oldPackage *PackageRevision, old, new *api.PackageRevisionResources) (*PackageRevision, *api.RenderStatus, error) ListFunctions(ctx context.Context, repositoryObj *configapi.Repository) ([]*Function, error) ListPackageRevisions(ctx context.Context, repositorySpec *configapi.Repository, filter repository.ListPackageRevisionFilter) ([]*PackageRevision, error) CreatePackageRevision(ctx context.Context, repositoryObj *configapi.Repository, obj *api.PackageRevision, parent *PackageRevision) (*PackageRevision, error) UpdatePackageRevision(ctx context.Context, repositoryObj *configapi.Repository, oldPackage *PackageRevision, old, new *api.PackageRevision, parent *PackageRevision) (*PackageRevision, error) DeletePackageRevision(ctx context.Context, repositoryObj *configapi.Repository, obj *PackageRevision) error ListPackages(ctx context.Context, repositorySpec *configapi.Repository, filter repository.ListPackageFilter) ([]*Package, error) CreatePackage(ctx context.Context, repositoryObj *configapi.Repository, obj *api.PorchPackage) (*Package, error) UpdatePackage(ctx context.Context, repositoryObj *configapi.Repository, oldPackage *Package, old, new *api.PorchPackage) (*Package, error) DeletePackage(ctx context.Context, repositoryObj *configapi.Repository, obj *Package) error }
func NewCaDEngine ¶
func NewCaDEngine(opts ...EngineOption) (CaDEngine, error)
type EngineOption ¶
type EngineOption interface {
// contains filtered or unexported methods
}
func WithBuiltinFunctionRuntime ¶
func WithBuiltinFunctionRuntime() EngineOption
func WithCache ¶
func WithCache(cache *cache.Cache) EngineOption
func WithCredentialResolver ¶
func WithCredentialResolver(resolver repository.CredentialResolver) EngineOption
func WithFunctionRuntime ¶
func WithFunctionRuntime(runtime fn.FunctionRuntime) EngineOption
func WithGRPCFunctionRuntime ¶
func WithGRPCFunctionRuntime(address string) EngineOption
func WithMetadataStore ¶
func WithMetadataStore(metadataStore meta.MetadataStore) EngineOption
func WithReferenceResolver ¶
func WithReferenceResolver(resolver ReferenceResolver) EngineOption
func WithRunnerOptions ¶
func WithRunnerOptions(options fnruntime.RunnerOptions) EngineOption
func WithRunnerOptionsResolver ¶
func WithRunnerOptionsResolver(fn func(namespace string) fnruntime.RunnerOptions) EngineOption
func WithSimpleFunctionRuntime ¶
func WithSimpleFunctionRuntime() EngineOption
func WithUserInfoProvider ¶
func WithUserInfoProvider(provider repository.UserInfoProvider) EngineOption
func WithWatcherManager ¶
func WithWatcherManager(watcherManager *watcherManager) EngineOption
type EngineOptionFunc ¶
type EngineOptionFunc func(engine *cadEngine) error
type Function ¶
type Function struct {
RepoFunction repository.Function
}
type NodeToMapWriter ¶
type ObjectWatcher ¶
type ObjectWatcher interface {
OnPackageRevisionChange(eventType watch.EventType, obj repository.PackageRevision, objMeta meta.PackageRevisionMeta) bool
}
PackageRevisionWatcher is the callback interface for watchers.
type Package ¶
type Package struct {
// contains filtered or unexported fields
}
func (*Package) GetPackage ¶
func (p *Package) GetPackage() *api.PorchPackage
func (*Package) KubeObjectName ¶
type PackageFetcher ¶
type PackageFetcher struct {
// contains filtered or unexported fields
}
func (*PackageFetcher) FetchResources ¶
func (p *PackageFetcher) FetchResources(ctx context.Context, packageRef *api.PackageRevisionRef, namespace string) (*api.PackageRevisionResources, error)
func (*PackageFetcher) FetchRevision ¶
func (p *PackageFetcher) FetchRevision(ctx context.Context, packageRef *api.PackageRevisionRef, namespace string) (repository.PackageRevision, error)
type PackageRevision ¶
type PackageRevision struct {
// contains filtered or unexported fields
}
func ToPackageRevision ¶
func ToPackageRevision(pkgRev repository.PackageRevision, pkgRevMeta meta.PackageRevisionMeta) *PackageRevision
TODO: This is a bit awkward, and we should see if there is a way to avoid having to expose this function. Any functionality that requires creating new engine.PackageRevision resources should be in the engine package.
func (*PackageRevision) GetPackageRevision ¶
func (p *PackageRevision) GetPackageRevision(ctx context.Context) (*api.PackageRevision, error)
func (*PackageRevision) GetResources ¶
func (p *PackageRevision) GetResources(ctx context.Context) (*api.PackageRevisionResources, error)
func (*PackageRevision) KubeObjectName ¶
func (p *PackageRevision) KubeObjectName() string
type ReferenceResolver ¶
type RepositoryOpener ¶
type RepositoryOpener interface {
OpenRepository(ctx context.Context, repositorySpec *configapi.Repository) (repository.Repository, error)
}
type WatcherManager ¶
type WatcherManager interface {
WatchPackageRevisions(ctx context.Context, filter repository.ListPackageRevisionFilter, callback ObjectWatcher) error
}
ObjectCache caches objects across repositories, and allows for watching.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.