Documentation
¶
Overview ¶
Package python executes the user-provided Python used by Helm value templating.
Scripts run in a fresh Gomonty REPL for every job. The sandbox does not expose OS, network, or environment access. Jobs started with RunInDir see that directory read-only at /repo, which is also their working directory, through pathlib, open, os.walk, and the fs.read and fs.walk helpers that mirror the Lua fs module. Writes and paths outside /repo raise PermissionError. Host callbacks are limited to the read-only k8s_object_meta lookup against the agent cache and the pure yaml_encode, yaml_decode, and merge helpers.
Index ¶
Constants ¶
const ( // ExecutionTimeout bounds queue admission and execution for one job. ExecutionTimeout = 10 * time.Second )
Variables ¶
This section is empty.
Functions ¶
func SetDefaultPool ¶
func SetDefaultPool(pool *Pool)
SetDefaultPool installs the process-wide pool used by Helm rendering. The caller owns the pool and must close it during application shutdown.
func SetObjectMetaLookup ¶ added in v0.6.67
func SetObjectMetaLookup(fn ObjectMetaLookup)
SetObjectMetaLookup installs the process-wide cache lookup used by k8s_object_meta. Pass nil to clear it.
Types ¶
type Config ¶
type Config struct {
MaxConcurrentReconciles int
WorkerCount int
QueueSize int
ExecutionTimeout time.Duration
}
Config controls a Pool. WorkerCount and QueueSize are intended primarily for focused tests. Production callers should set MaxConcurrentReconciles so the fixed pool sizing policy is applied at startup.
type ObjectMetaLookup ¶ added in v0.6.67
ObjectMetaLookup returns cached Kubernetes object metadata for Helm Python scripts. A nil map means the object is not in the cache.
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
Pool owns a fixed set of workers and a bounded queue. It is safe for concurrent use. Close waits for workers to stop and is idempotent.
func DefaultPool ¶
func DefaultPool() *Pool
DefaultPool returns the pool installed by the application startup path.
func NewPool ¶
NewPool creates and health-checks a fixed-size worker pool. The health check eagerly loads Gomonty's native runtime, making startup failures visible before the first service render.
func NewPoolWithConfig ¶
NewPoolWithConfig is the configurable constructor used by tests and by callers that need to provide an explicit pool size.
func (*Pool) Close ¶
Close stops accepting work, cancels executing jobs, and waits for all workers. Jobs that have not started are discarded with the pool.