Documentation
¶
Overview ¶
Package appversion holds shared helpers for managing AppVersion entities and the resources that hang off them. It is consumed by both the ephemeral GC (TTL expiry) and the version retention GC (count/age pruning) so the deletion cascade lives in exactly one place.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Delete ¶
func Delete(ctx context.Context, eac *entityserver_v1alpha.EntityAccessClient, version *core_v1alpha.AppVersion, log *slog.Logger) error
Delete hard-deletes an AppVersion and its 1:1 ConfigVersion.
It deliberately does NOT touch sandbox pools. The sandbox pool Manager owns pool lifecycle: on deploy the launcher de-refs and scales superseded pools to zero, and the Manager's sweep reaps drained pools that no current version references (see controllers/sandboxpool). By the time a version is old enough to prune, its pools are already gone. Callers that need immediate pool teardown rather than waiting for that sweep should use DeleteWithPools.
ConfigVersion cleanup is best-effort: an orphaned ConfigVersion holds no blobs, so a failure there is logged but does not block deleting the version.
func DeleteWithPools ¶
func DeleteWithPools(ctx context.Context, eac *entityserver_v1alpha.EntityAccessClient, version *core_v1alpha.AppVersion, log *slog.Logger) error
DeleteWithPools tears down the version's sandbox pools before deleting the version, for callers (e.g. ephemeral TTL expiry) that want prompt teardown instead of waiting for the pool Manager's idle sweep. Pools referenced only by this version are deleted; pools shared with other versions keep their remaining references.
Pool cleanup runs first. If it fails, the AppVersion is retained so a future pass can retry — otherwise we would leak pools that can no longer be traced back to any version.
Types ¶
This section is empty.