Documentation
¶
Index ¶
- Constants
- func DeleteExpired(ctx context.Context, eac *entityserver_v1alpha.EntityAccessClient, ...) (int, error)
- func DeleteVersion(ctx context.Context, eac *entityserver_v1alpha.EntityAccessClient, ...) error
- func EnforceLimit(ctx context.Context, eac *entityserver_v1alpha.EntityAccessClient, ...) error
- func LookupByLabel(ctx context.Context, eac *entityserver_v1alpha.EntityAccessClient, ...) (*core_v1alpha.AppVersion, error)
- func NormalizeLabel(input string) (string, error)
- func ReplaceExisting(ctx context.Context, eac *entityserver_v1alpha.EntityAccessClient, ...) error
- func ValidateLabel(label string) error
Constants ¶
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 ¶
func LookupByLabel(ctx context.Context, eac *entityserver_v1alpha.EntityAccessClient, appID entity.Id, label string) (*core_v1alpha.AppVersion, error)
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 ¶
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 ¶
ValidateLabel checks that a label conforms to DNS label rules (RFC 1123).
Types ¶
This section is empty.