ephemeral

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultMaxEphemeral = 10

Variables

This section is empty.

Functions

func DeleteExpired

func DeleteExpired(ctx context.Context, eac *entityserver_v1alpha.EntityAccessClient, appID entity.Id, log *slog.Logger) (int, error)

DeleteExpired finds and deletes all ephemeral versions that have passed their expiration time for the given app.

func DeleteVersion

func DeleteVersion(ctx context.Context, eac *entityserver_v1alpha.EntityAccessClient, versionID entity.Id, log *slog.Logger) error

DeleteVersion deletes an ephemeral AppVersion and its associated sandbox pools.

func EnforceLimit

func EnforceLimit(ctx context.Context, eac *entityserver_v1alpha.EntityAccessClient, appID entity.Id, maxEphemeral int, log *slog.Logger) error

EnforceLimit ensures the number of ephemeral versions for an app does not exceed the given maximum. If at the limit, the version nearest to expiry is evicted to make room.

func LookupByLabel

LookupByLabel finds an ephemeral AppVersion for the given app and label. Returns nil if no matching version exists or the version has expired.

func NormalizeLabel

func NormalizeLabel(input string) (string, error)

NormalizeLabel converts an input string (typically a Git branch name) into a DNS-compliant label suitable for use as a subdomain. The rules follow RFC 1123: lowercase alphanumeric and hyphens, starting and ending with alphanumeric, max 63 characters.

func ReplaceExisting

func ReplaceExisting(ctx context.Context, eac *entityserver_v1alpha.EntityAccessClient, appID entity.Id, label string, log *slog.Logger) error

ReplaceExisting finds and deletes an existing ephemeral version with the same label for the given app. This ensures deploying with an existing label replaces the old version. Associated sandbox pools are cleaned up via their referenced_by_versions index.

func ValidateLabel

func ValidateLabel(label string) error

ValidateLabel checks that a label conforms to DNS label rules (RFC 1123).

Types

This section is empty.

Jump to

Keyboard shortcuts

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