engine

package
v1.6.4-pre.3 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: Apache-2.0 Imports: 39 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

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 NewMultiFunctionRuntime added in v1.6.0

func NewMultiFunctionRuntime(ctx context.Context, opts MultiFunctionRuntimeOptions) (fn.FunctionRuntime, error)

NewMultiFunctionRuntime creates a FunctionRuntime that tries builtin functions first, then gRPC fn-runner (exec), then porch-server's pod evaluator over gRPC, then an in-process pod evaluator when configured.

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 repository.PackageRevision, old, new *porchapi.PackageRevisionResources, resourceSelector selector.PRRUpdate) (repository.PackageRevision, *porchapi.RenderStatus, error)
	UpdatePackageResourcesWithoutRender(ctx context.Context, repositoryObj *configapi.Repository, oldPackage repository.PackageRevision, old, new *porchapi.PackageRevisionResources) (repository.PackageRevision, error)

	ListPackageRevisions(ctx context.Context, filter repository.ListPackageRevisionFilter) ([]repository.PackageRevision, error)
	CreatePackageRevision(ctx context.Context, repositoryObj *configapi.Repository, obj *porchapi.PackageRevision, parent repository.PackageRevision) (repository.PackageRevision, error)
	UpdatePackageRevision(ctx context.Context, version int, repositoryObj *configapi.Repository, oldPackage repository.PackageRevision, old, new *porchapi.PackageRevision, parent repository.PackageRevision) (repository.PackageRevision, error)
	DeletePackageRevision(ctx context.Context, repositoryObj *configapi.Repository, obj repository.PackageRevision) error

	ListPackages(ctx context.Context, repositorySpec *configapi.Repository, filter repository.ListPackageFilter) ([]repository.Package, error)

	FindAllUpstreamReferencesInRepositories(ctx context.Context, namespace, prName string) (string, error)
}

func NewCaDEngine

func NewCaDEngine(opts ...EngineOption) (CaDEngine, error)

type EngineOption

type EngineOption interface {
	// contains filtered or unexported methods
}

func WithBuiltinFunctionRuntime

func WithBuiltinFunctionRuntime(functionConfigStore *functionconfigs.FunctionConfigStore) EngineOption

func WithCache

func WithCache(cache cachetypes.Cache) EngineOption

func WithCredentialResolver

func WithCredentialResolver(resolver repository.CredentialResolver) EngineOption

func WithGRPCFunctionRuntime

func WithGRPCFunctionRuntime(options GRPCRuntimeOptions, functionConfigStore *functionconfigs.FunctionConfigStore) EngineOption

func WithLifecyclePolicy

func WithLifecyclePolicy(policy lifecycle.Options) EngineOption

func WithPodEvaluatorRuntime

func WithPodEvaluatorRuntime(ctx context.Context, podEvaluatorOptions podevaluator.PodEvaluatorOptions, kubeClient client.WithWatch, functionConfigStore *functionconfigs.FunctionConfigStore) EngineOption

func WithReferenceResolver

func WithReferenceResolver(resolver repository.ReferenceResolver) EngineOption

func WithRepoOperationRetryAttempts

func WithRepoOperationRetryAttempts(retryAttempts int) EngineOption

func WithRunnerOptionsResolver

func WithRunnerOptionsResolver(fn func(namespace string) runneroptions.RunnerOptions) 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 ExecutableEvaluatorOptions

type ExecutableEvaluatorOptions struct {
	FunctionCacheDir string
}

type GRPCRuntimeOptions

type GRPCRuntimeOptions struct {
	FunctionRunnerAddress string
	MaxGrpcMessageSize    int
	DefaultImagePrefix    string
	// SkipExecPath restores Function Runner-style client behavior: GetRunner
	// always returns a runner and EvaluateFunction is sent without exec_path.
	// Use this for porch-server's pod-evaluator gRPC service.
	SkipExecPath bool
}

type MultiFunctionRuntimeOptions

type MultiFunctionRuntimeOptions struct {
	GRPCAddress         string
	PodEvaluatorAddress string
	MaxGrpcMessageSize  int
	FunctionConfigStore *functionconfigs.FunctionConfigStore
	PodEvaluator        *podevaluator.PodEvaluatorOptions
	KubeClient          client.WithWatch
	DefaultImagePrefix  string
}

MultiFunctionRuntimeOptions configures the function runtime chain: builtin, optional gRPC fn-runner (exec), optional porch-server pod-evaluator gRPC, and optional in-process pod evaluator.

type ObjectWatcher

type ObjectWatcher interface {
	OnPackageRevisionChange(eventType watch.EventType, obj repository.PackageRevision) bool
}

PackageRevisionWatcher is the callback interface for watchers.

type WatcherManager

type WatcherManager interface {
	WatchPackageRevisions(ctx context.Context, filter repository.ListPackageRevisionFilter, callback ObjectWatcher) error
}

ObjectCache caches objects across repositories, and allows for watching.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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