stackresource

package
v0.0.5-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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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