Documentation
¶
Overview ¶
Package stackdeploy converts a draft stack (user-authored state from the DB) into an effective stack: connections, self outputs, and volume relationships resolved into the concrete values the cluster CR builder consumes.
Index ¶
- func CloneStack(stack *models.Stack) (*models.Stack, error)
- func PostgresConnectionConfig(connection models.StackConnection) (database string, superuser bool, err error)
- func PostgresCredentialSecretName(addonID, database string) string
- func ResolveTemplate(tmplStr string, data map[string]string) (string, error)
- func ValidateTemplateKeys(tmplStr string, values map[string]models.OutputValueRef) error
- type DependencyNotReadyError
- type PostgresAddonService
- type Resolver
- type ResolverSpec
- type SecretService
- type VolumeService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CloneStack ¶
CloneStack deep-copies a stack via JSON so the resolver never mutates the caller's draft.
func PostgresConnectionConfig ¶
func PostgresConnectionConfig(connection models.StackConnection) (database string, superuser bool, err error)
func PostgresCredentialSecretName ¶
PostgresCredentialSecretName returns the deterministic K8s Secret name for projected postgres credentials in a stack's namespace. The format is pgcred-<8-char-hash>-<sanitized-database>.
func ResolveTemplate ¶
ResolveTemplate executes a Go text/template string against the provided data. Template keys are registered as zero-arg functions so {{ key }} syntax works without a dot prefix. Keys must be valid Go identifiers (letters, digits, underscores; cannot start with a digit).
func ValidateTemplateKeys ¶
func ValidateTemplateKeys(tmplStr string, values map[string]models.OutputValueRef) error
ValidateTemplateKeys checks that all keys in the values map are valid Go identifiers and that the template string parses successfully.
Types ¶
type DependencyNotReadyError ¶
type DependencyNotReadyError struct {
Message string
}
DependencyNotReadyError signals that a backing resource is not available yet and resolution should be retried.
func (DependencyNotReadyError) Error ¶
func (e DependencyNotReadyError) Error() string
type PostgresAddonService ¶
type PostgresAddonService interface {
InternalGetPostgresAddon(ctx context.Context, id string) (*models.PostgresAddon, *errors.ServiceError)
InternalGetCredentials(ctx context.Context, addonID string, database string, superuser bool) (*models.PostgresCredentials, *errors.ServiceError)
}
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
func NewResolver ¶
func NewResolver(spec ResolverSpec) *Resolver
type ResolverSpec ¶
type ResolverSpec struct {
VolumeService VolumeService
PostgresAddonService PostgresAddonService
SecretService SecretService
}