Documentation
¶
Overview ¶
Package run defines the Run entity: one execution of an app task.
It is its own domain rather than part of core because the schema generator turns enum choices into bare package-level identifiers, and PENDING, RUNNING, and FAILED are too generic to add to core_v1alpha permanently. Entity ids are unaffected -- they derive from the kind, so a run is still run/{name}.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MaxConcurrent ¶
func MaxConcurrent(task *core_v1alpha.ConfigSpecTasks, taskName string) int64
MaxConcurrent resolves a task's ceiling on simultaneous runs.
Shared rather than duplicated because two sides have to agree on the number: the run controller enforces it at admission, and the app server quotes it when refusing a manual invoke. If those disagree the refusal is a lie -- it names a limit the controller does not apply -- so they read it from here.
task is nil when the app never declared it, which is the ordinary case for the console convention and the reason the two defaults differ.
func SandboxName ¶
SandboxName derives the sandbox a run's attempt executes in.
The derivation is shared rather than duplicated because two sides depend on agreeing exactly: the run controller creates the sandbox under this name, and the app server hands the same string to a client so it can attach without waiting to observe the sandbox appear. Two copies of one naming rule drift silently -- change the prefix on one side and the other keeps returning the old name, leaving the client retrying against a sandbox that will never exist and reporting a generic attach failure.
Being derived rather than allocated is also what makes creation idempotent: the same run and attempt always name the same sandbox, so a lost create reply cannot produce two sandboxes running the command.
Types ¶
This section is empty.