stackresource

package
v0.0.6-alpha Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2026 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Validator

type Validator interface {
	Validate(ctx context.Context, stack *models.Stack, resource *models.StackResource, siblings []*models.StackResource) ([]errors.FieldError, *errors.ServiceError)
}

Validator runs every cheap (input-only, DB-only, sibling) validation for a single stack resource and returns all failures. It never touches the network. A non-nil ServiceError means a lookup failed for reasons other than not-found (e.g. a DB outage) and validation was aborted; the caller should turn it into a 500 rather than trusting the (nil) FieldError slice.

func NewValidator

func NewValidator(spec ValidatorSpec) Validator

NewValidator wires the shared per-resource validator. Every seam is required: this validator runs the full referential-integrity rule set unconditionally, so a missing seam would silently skip whatever rule it backs rather than fail loudly. Callers that genuinely don't need a namespace-scoped DB lookup for volumes (e.g. the whole-stack fat path, where bundled volumes aren't persisted yet) still pass a real store: see the payload-first check in validateMountedVolumes.

type ValidatorSpec

type ValidatorSpec struct {
	Volumes            volumeGetter
	Secrets            secretGetter
	Domains            domainLister
	Credentials        credentials.Resolver
	GitIntegrations    gitIntegrationGetter
	PlatformBaseDomain string
}

Jump to

Keyboard shortcuts

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