models

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: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CloudflareAPITokenSecretName  = "cloudflare-api-token"
	CloudflareAPITokenSecretKey   = "api-token"
	DNSIssuerName                 = "letsencrypt-dns"
	DNSIssuerPrivateKeySecretName = "letsencrypt-dns-key"
	PlatformWildcardTLSName       = "platform-wildcard-tls"
)

Fixed names for the platform wildcard TLS resources. The DNS Issuer and its supporting Secret are namespace-scoped, so all of these resources reside in the namespace selected by the bootstrap configuration.

View Source
const (
	// DefaultRegistryStorageSize applies to registries created via the API
	// on an org's own cluster.
	DefaultRegistryStorageSize = "50Gi"
	// DefaultPlatformOrgRegistryStorageSize applies to the registry seeded
	// for each org at signup on the shared-compute cluster.
	DefaultPlatformOrgRegistryStorageSize = "10Gi"
)
View Source
const (
	GitTokenMintedAtAnnotation  = "stackdome.io/git-token-minted-at"
	GitTokenExpiresAtAnnotation = "stackdome.io/git-token-expires-at"
	GitIntegrationIDAnnotation  = "stackdome.io/git-integration-id"
)

Annotations stamped on cluster secrets synced from minted GitHub App installation tokens, driving hub-side refresh.

View Source
const (
	GitTokenRefreshFailedConditionType   = "GitTokenRefreshFailed"
	GitTokenRefreshFailedConditionReason = "MintFailed"
)

Condition recorded on image builds when a GitHub App token refresh fails.

View Source
const (
	DefaultDockerfilePath = "Dockerfile"
	DefaultBuildContext   = "."
)
View Source
const (
	ManagedByLabelKey      = "stackdome.io/managed-by"
	ManagedByLabelValue    = "stackdome"
	CloudTenantLabelKey    = "stackdome.io/cloud-tenant"
	CloudTenantLabelValue  = "true"
	OrganizationIDLabelKey = "stackdome.io/organization-id"
	NamespaceRoleLabelKey  = "stackdome.io/namespace-role"
	NamespaceRoleStack     = "stack"
	NamespaceRoleAddon     = "addon"
)
View Source
const (
	// KubernetesDNSLabelMaxLength is the RFC 1123 DNS-label cap Kubernetes
	// applies to namespace names and label values.
	KubernetesDNSLabelMaxLength = 63
	// NamespaceNameSeparator joins the stack name and the UUID suffix in a
	// generated namespace name.
	NamespaceNameSeparator = "-"
	// NamespaceUUIDLength is the length of canonical RFC 4122 UUID text (as
	// produced by uuid.UUID.String()).
	NamespaceUUIDLength = 36
	// NamespaceUUIDSuffixLength is the length of the full
	// "<separator><uuid>" suffix appended to the stack name before
	// truncation. Short stack names keep it whole.
	NamespaceUUIDSuffixLength = len(NamespaceNameSeparator) + NamespaceUUIDLength
	// MinNamespaceUUIDSuffixLength is the entropy floor: at least this many
	// UUID characters must survive truncation so generated namespace names
	// stay effectively collision-free.
	MinNamespaceUUIDSuffixLength = 8
	// MaxStackNameLength is the stack-name budget inside a generated
	// namespace name: the DNS-label cap minus the separator and the entropy
	// floor (63 - 1 - 8 = 54).
	MaxStackNameLength = KubernetesDNSLabelMaxLength - len(NamespaceNameSeparator) - MinNamespaceUUIDSuffixLength
)

Stack namespaces are generated as "<stack-name>-<uuid>" and then truncated from the end to the DNS-label cap (see PrepareNamespaceForStack in pkg/services/namespace_service.go). A Kubernetes namespace name is an RFC 1123 DNS label capped at 63 characters; truncation cuts the UUID tail, so the stack name only has to leave room for the separator plus the minimum surviving slice of UUID entropy — not the full UUID. Namespace generation and stack-name validation both derive from these constants — they are the single source of truth for that budget.

View Source
const (
	// AddonNamespacePrefix prefixes every generated addon namespace name.
	AddonNamespacePrefix = "stackdome-addons"
	// MaxAddonTypeLength reserves room for the longest addon type slug
	// ("postgres") in the addon-name budget.
	MaxAddonTypeLength = 8
	// MaxAddonNameLength is the addon-name budget inside a generated
	// namespace name: the DNS-label cap minus the prefix, the type reservation,
	// the three separators (prefix-type, type-name, name-uuid), and the entropy
	// floor (63 - 16 - 8 - 3 - 8 = 28).
	MaxAddonNameLength = KubernetesDNSLabelMaxLength - len(AddonNamespacePrefix) - MaxAddonTypeLength - 3*len(NamespaceNameSeparator) - MinNamespaceUUIDSuffixLength
)

Addon namespaces are generated as "stackdome-addons-<type>-<name>-<uuid>" and truncated from the end to the DNS-label cap (see PrepareNamespaceForAddon in pkg/services/namespace_service.go). These constants are the single source of truth for the addon-name budget, mirroring the stack-name budget above.

View Source
const (
	OAuthProviderGitHub = "github"
	OAuthStateTableName = "oauth_states"
)
View Source
const (
	OutputNameHost          = "host"
	OutputNamePort          = "port"
	OutputNameDatabase      = "database"
	OutputNameUsername      = "username"
	OutputNamePassword      = "password"
	OutputNameSSLMode       = "sslmode"
	OutputNameCACertificate = "ca_certificate"
	OutputNameURL           = "url"
	OutputNamePublicHost    = "public_host"
	OutputNamePublicURL     = "public_url"
)
View Source
const (
	PostgresAddonIDLabel = "postgres-addon.stackdome.io/id"
	DefaultDatabaseName  = "app"
)
View Source
const (
	PreviewStackLabel    = "preview.stackdome.io/preview-stack"
	PreviewConfigIDLabel = "preview.stackdome.io/config-id"
	PreviewPRNumberLabel = "preview.stackdome.io/pr-number"
	PreviewStackIDLabel  = "preview.stackdome.io/preview-id"
)
View Source
const (
	ReleaseEventMetaReason  = "reason"
	ReleaseEventMetaCheck   = "check"
	ReleaseEventMetaBuildID = "build_id"
)

Well-known metadata keys.

View Source
const (
	RegistrySecretKey = "registry"
	UsernameSecretKey = "username"
	PasswordSecretKey = "password"
	SshSecretKey      = "ssh_private_key"
	TokenSecretKey    = "token"
)
View Source
const (
	SecretDataHashAnnotation = "stackdome.io/secret-data-hash"
	SecretIDAnnotation       = "stackdome.io/secret-id"
)
View Source
const (
	StackIDLabel       = "core.stackdome.io/stack-id"
	StackIDAnnotation  = "stack.stackdome.io/id"
	StackRevisionLabel = "stack.stackdome.io/revision"
)
View Source
const (
	SkipClusterProvisioningAnnotation = "stack.stackdome.io/skip-cluster-provisioning"
	SimulateReleaseStateAnnotation    = "stack.stackdome.io/simulate-release-state"
)
View Source
const (
	DefaultReleaseRetentionLimit = 10
	DefaultMinSuccessfulReleases = 5

	MaxReleaseRetentionLimit = 50
	MaxMinSuccessfulReleases = 20
)
View Source
const (
	CredentialScopeOwner     = "owner"
	CredentialScopeSuperuser = "superuser"
)

Postgres credential_scope values

View Source
const (
	DefaultMaxActivePreviews = 10
	MaxMaxActivePreviews     = 50
	DefaultStackfilePath     = "stackfile.yaml"
	DefaultBaseBranch        = "main"
)
View Source
const (
	PortProtocolHTTP = "http"
	PortProtocolGRPC = "grpc"
	PortProtocolTCP  = "tcp"
)
View Source
const (
	VolumePhasePending = "Pending"
	VolumePhaseReady   = "Ready"
)
View Source
const (
	AssignedNodeAnnotation = "assigned-node"
)
View Source
const (
	CreatedForUserLabel = "user.stackdome.io/id"
)
View Source
const DefaultClusterIssuerName = "letsencrypt-prod"
View Source
const (
	DefaultObjectStoreRetentionPolicy = "7d"
)
View Source
const (
	DefaultProjectName = "default"
)
View Source
const (
	DependsOnTopologyEdgeKind = "depends_on"
)
View Source
const (
	ImageRegistryIDLabel = "registry.stackdome.io/id"
)
View Source
const LabelValueTrue = "true"
View Source
const OAuthProviderGitHubAppInstall = "github_app_install"

OAuthProviderGitHubAppInstall scopes platform-app install state records.

View Source
const OAuthProviderGitHubAppManifest = "github_app_manifest"

OAuthProviderGitHubAppManifest scopes manifest-flow state records.

View Source
const (
	ObjectServerGeneration = "managedobject.stackdome.io/generation"
)
View Source
const PlatformOrganisationName = "PlatformOrganisation"
View Source
const RegistryCredentialIDAnnotation = "stackdome.io/registry-credential-id"

RegistryCredentialIDAnnotation records which org-level registry credential a synced cluster secret was synthesized from.

View Source
const ReleaseCreatedByPreviewSync = "system:preview-sync"
View Source
const ReleaseEventLinkKindBuildLogs = "build_logs"

Link kinds.

View Source
const SharedComputeClusterName = "shared-compute"
View Source
const (
	VolumeIDLabel = "volume.stackdome.io/id"
)

Variables

NonGrippingReleaseStates lists release states that should NOT hold delete-protection ("grip") on referenced resources.

A release grips its referenced secrets/volumes/addons so that rolling back to it remains safe — the resources it needs must still exist. Only Released releases are valid rollback targets; Pending and InProgress releases may still converge and become the live deployment. Failed, Superseded, and Cancelled releases can never be redeployed, so their grip serves no purpose and would only block resource deletion until GC ages them out of the retention window.

Grip is derived at query time (LEFT JOIN on stack_releases.state) rather than toggled by a write on state transition, so it tracks release lifecycle automatically and cannot drift.

View Source
var SupportedPostgresExtensions = []string{
	"vector",
}

Functions

func IsConditionTrue

func IsConditionTrue(conditions []Condition, condType string) bool

func NormalizeRepoURL

func NormalizeRepoURL(url string) string

NormalizeRepoURL collapses scheme, userinfo, ".git" and trailing-slash variants to "host/owner/repo" so equivalent repo URLs compare equal.

func SetCondition

func SetCondition(conditions *[]Condition, cond Condition)

func UserOrgNameFromOauth

func UserOrgNameFromOauth(name string) string

Types

type APIToken

type APIToken struct {
	ID          string      `gorm:"primary_key;default:gen_random_uuid()" json:"id"`
	Name        string      `gorm:"not null" json:"name"`
	UserID      string      `gorm:"not null" json:"userId"`
	TokenHash   string      `gorm:"not null" json:"-"`
	TokenPrefix string      `gorm:"not null" json:"tokenPrefix"`
	Scopes      StringSlice `gorm:"type:jsonb;not null" json:"scopes"`
	ResourceIDs StringSlice `gorm:"type:jsonb" json:"resourceIds,omitempty"`
	OrgID       string      `gorm:"not null" json:"orgId"`
	ExpiresAt   *time.Time  `json:"expiresAt,omitempty"`
	LastUsedAt  *time.Time  `json:"lastUsedAt,omitempty"`
	CreatedAt   time.Time   `gorm:"not null" json:"createdAt"`
	RevokedAt   *time.Time  `json:"revokedAt,omitempty"`
}

func (APIToken) TableName

func (APIToken) TableName() string

type Addon

type Addon interface {
	Type() string
	AddonName() string
}

type Annotation

type Annotation struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type Annotations

type Annotations []Annotation

func (*Annotations) Scan

func (a *Annotations) Scan(value interface{}) error

func (Annotations) ToMap

func (a Annotations) ToMap() map[string]string

Annotations to map

func (Annotations) Value

func (a Annotations) Value() (driver.Value, error)

type AzureCredentials

type AzureCredentials struct {
	ConnectionString   SecretReference `json:"connectionString"`
	StorageAccountName string          `json:"storageAccountName"`
}

type BuildArtifactSource

type BuildArtifactSource struct {
	ResourceName    string `json:"resource_name"`
	SourcePath      string `json:"source_path"`
	DestinationPath string `json:"destination_path"`
}

func (*BuildArtifactSource) Scan

func (b *BuildArtifactSource) Scan(value interface{}) error

func (BuildArtifactSource) Value

func (b BuildArtifactSource) Value() (driver.Value, error)

type BuildArtifactSources

type BuildArtifactSources []BuildArtifactSource

func (*BuildArtifactSources) Scan

func (b *BuildArtifactSources) Scan(value interface{}) error

func (BuildArtifactSources) Value

func (b BuildArtifactSources) Value() (driver.Value, error)

type BuildArtifactSyncInfo

type BuildArtifactSyncInfo struct {
	ResourceName string `json:"resource_name"`
	BuildID      string `json:"build_id"`
	Status       string `json:"status"`
}

func (*BuildArtifactSyncInfo) Scan

func (b *BuildArtifactSyncInfo) Scan(value interface{}) error

func (BuildArtifactSyncInfo) Value

func (b BuildArtifactSyncInfo) Value() (driver.Value, error)

type BuildConfigSpec

type BuildConfigSpec struct {
	SourceContext           BuildContextSource   `json:"source_context"`
	ContextPathWithinSource string               `json:"context_path_within_source"`
	DockerfilePath          string               `json:"dockerfile_path"`
	SourceRevision          BuildSourceRevision  `json:"source_revision"`
	BuildImageRepository    BuildImageRepository `json:"build_image_repository"`
	// PushRegistryCredentialID pins an org-level registry credential for the
	// push target, overriding host auto-attach.
	PushRegistryCredentialID string `json:"push_registry_credential_id,omitempty"`
}

func (*BuildConfigSpec) Scan

func (bc *BuildConfigSpec) Scan(value interface{}) error

func (*BuildConfigSpec) Validate

func (b *BuildConfigSpec) Validate() error

func (BuildConfigSpec) Value

func (bc BuildConfigSpec) Value() (driver.Value, error)

type BuildContextSource

type BuildContextSource struct {
	Volume *VolumeBuildSource `json:"volume"`
	Git    *GitBuildSource    `json:"git"`
}

type BuildFailureDetail

type BuildFailureDetail struct {
	FailureType  string `json:"failure_type"`
	Reason       string `json:"reason,omitempty"`
	Message      string `json:"message,omitempty"`
	RestartCount int32  `json:"restart_count"`
	ExitCode     *int32 `json:"exit_code,omitempty"`
}

type BuildImageRepository

type BuildImageRepository struct {
	InsecureRegistry     bool   `json:"insecure_registry"`
	UseInClusterRegistry bool   `json:"use_in_cluster_registry"`
	ClusterRegistryName  string `json:"cluster_registry_name,omitempty"`
	ExternalImageRef     string `json:"external_image_ref,omitempty"`
}

type BuildSourceRevision

type BuildSourceRevision struct {
	Volume *VolumeRevision `json:"volume"`
	Git    *GitRevision    `json:"git"`
}

type Cluster

type Cluster struct {
	ID                     string `gorm:"primary_key;default:gen_random_uuid()"`
	OrganisationID         string `gorm:"not null"`
	Name                   string `gorm:"not null;check:name <> ''"`
	CreatedAt              time.Time
	UpdatedAt              time.Time
	DeletionTimestamp      *time.Time `json:"deletion_timestamp,omitempty"`
	SharedCompute          bool
	ClusterURL             string `gorm:"not null;check:cluster_url <> '';uniqueIndex:idx_clusters_cluster_url_unique"`
	EncryptedClusterCAData string `gorm:"not null"`
	EncryptedToken         string `gorm:"not null"`
	ManagerRunning         bool
	ClusterInfo            *ClusterInfo            `gorm:"type:jsonb"`
	ImageRegistries        []*ClusterImageRegistry `gorm:"foreignKey:ClusterID"`

	// Transient fields — populated by service layer after decryption, never persisted
	ClusterCAData string `gorm:"-"`
	Token         string `gorm:"-"`
}

type ClusterImageRegistry

type ClusterImageRegistry struct {
	ID                  string `gorm:"primary_key;default:gen_random_uuid()" json:"id"`
	ClusterID           string `gorm:"not null;index:idx_cluster_image_registry_cluster_id" json:"cluster_id"`
	OrganisationID      string `gorm:"not null;index:idx_cluster_image_registry_organisation_id" json:"organisation_id"`
	Name                string `gorm:"not null;check:name <> ''" json:"name"`
	BackendStorageSize  string `gorm:"not null;check:backend_storage_size <> ''" json:"backend_storage_size"`
	BackendStorageClass string
	Status              *ClusterImageRegistryStatus `gorm:"type:jsonb" json:"status"`
}

type ClusterImageRegistryOperand

type ClusterImageRegistryOperand struct{ ClusterID string }

ClusterImageRegistryOperand serializes all registry reconciliation for one cluster, including cluster deletion once its registries have been removed.

type ClusterImageRegistryStatus

type ClusterImageRegistryStatus struct {
	State       RegistryState `json:"state"`
	Conditions  []Condition   `json:"conditions"`
	RegistryUrl string        `json:"registry_url"`
}

func (*ClusterImageRegistryStatus) Scan

func (c *ClusterImageRegistryStatus) Scan(value interface{}) error

Scan and value methods for ClusterImageRegistryStatus

func (ClusterImageRegistryStatus) Value

type ClusterInfo

type ClusterInfo struct {
	Phase             ClusterInfoPhase      `json:"phase,omitempty"`
	LastRefreshedAt   *time.Time            `json:"lastRefreshedAt,omitempty"`
	KubernetesVersion string                `json:"kubernetesVersion,omitempty"`
	TotalNodes        int                   `json:"totalNodes,omitempty"`
	ReadyNodes        int                   `json:"readyNodes,omitempty"`
	AvailabilityZones []string              `json:"availabilityZones,omitempty"`
	Nodes             []ClusterNode         `json:"nodes,omitempty"`
	StorageClasses    []ClusterStorageClass `json:"storageClasses,omitempty"`
	LoadBalancers     []ClusterLoadBalancer `json:"loadBalancers,omitempty"`
	IngressClasses    []ClusterIngressClass `json:"ingressClasses,omitempty"`
}

func (*ClusterInfo) DefaultStorageClass

func (c *ClusterInfo) DefaultStorageClass() string

DefaultStorageClass returns the name of the cluster's default StorageClass, or "" when none is marked default.

func (*ClusterInfo) Scan

func (c *ClusterInfo) Scan(value interface{}) error

func (ClusterInfo) Value

func (c ClusterInfo) Value() (driver.Value, error)

type ClusterInfoPhase

type ClusterInfoPhase string
const (
	ClusterInfoPhaseReady      ClusterInfoPhase = "Ready"
	ClusterInfoPhaseRefreshing ClusterInfoPhase = "Refreshing"
	ClusterInfoPhaseUnknown    ClusterInfoPhase = "Unknown"
)

type ClusterIngressClass

type ClusterIngressClass struct {
	Name       string `json:"name"`
	Controller string `json:"controller,omitempty"`
	IsDefault  bool   `json:"isDefault"`
}

type ClusterLoadBalancer

type ClusterLoadBalancer struct {
	ServiceName      string   `json:"serviceName"`
	ServiceNamespace string   `json:"serviceNamespace"`
	IngressIPs       []string `json:"ingressIPs,omitempty"`
	IngressHostnames []string `json:"ingressHostnames,omitempty"`
	HasIP            bool     `json:"hasIP"`
}

type ClusterNode

type ClusterNode struct {
	Name                     string             `json:"name"`
	Ready                    bool               `json:"ready"`
	AllocatableCPU           *resource.Quantity `json:"allocatableCpu,omitempty"`
	AllocatableMemory        *resource.Quantity `json:"allocatableMemory,omitempty"`
	AllocatableEphemeralDisk *resource.Quantity `json:"allocatableEphemeralDisk,omitempty"`
	CapacityEphemeralDisk    *resource.Quantity `json:"capacityEphemeralDisk,omitempty"`
	Zone                     string             `json:"zone,omitempty"`
	Region                   string             `json:"region,omitempty"`
}

type ClusterStorageClass

type ClusterStorageClass struct {
	Name        string `json:"name"`
	Provisioner string `json:"provisioner,omitempty"`
	IsDefault   bool   `json:"isDefault"`
}

type Condition

type Condition struct {
	Type               string    `json:"type"`
	Status             string    `json:"status"`
	LastTransitionTime time.Time `json:"last_transition_time"`
	Reason             string    `json:"reason"`
	Message            string    `json:"message"`
}

func ConvertConditions

func ConvertConditions(k8sconditions []metav1.Condition) []Condition

func FindCondition

func FindCondition(conditions []Condition, condType string) *Condition

type ConditionStatus

type ConditionStatus string
const (
	ConditionTrue    ConditionStatus = "True"
	ConditionFalse   ConditionStatus = "False"
	ConditionUnknown ConditionStatus = "Unknown"
)

type ConnectionConfig

type ConnectionConfig map[string]interface{}

func (*ConnectionConfig) Scan

func (c *ConnectionConfig) Scan(value interface{}) error

func (ConnectionConfig) Value

func (c ConnectionConfig) Value() (driver.Value, error)

type ConnectionConfigKey

type ConnectionConfigKey string
const (
	// Postgres addon config keys
	ConnectionConfigKeyDatabase        ConnectionConfigKey = "database"
	ConnectionConfigKeyCredentialScope ConnectionConfigKey = "credential_scope"
	ConnectionConfigKeySuperuser       ConnectionConfigKey = "superuser"

	// Volume mount config keys
	ConnectionConfigKeyMountPath ConnectionConfigKey = "mount_path"
	ConnectionConfigKeySubPath   ConnectionConfigKey = "sub_path"
	ConnectionConfigKeyReadOnly  ConnectionConfigKey = "read_only"

	// Build artifact source config keys
	ConnectionConfigKeySourcePath      ConnectionConfigKey = "source_path"
	ConnectionConfigKeyDestinationPath ConnectionConfigKey = "destination_path"
)

type ConnectionKind

type ConnectionKind string
const (
	ConnectionKindEnv                 ConnectionKind = "env"
	ConnectionKindVolumeMount         ConnectionKind = "volume_mount"
	ConnectionKindBuildArtifactSource ConnectionKind = "build_artifact_source"
)

func (ConnectionKind) String

func (k ConnectionKind) String() string

type ConnectionMapping

type ConnectionMapping struct {
	Target ConnectionTarget `json:"target"`
	Value  ValueRef         `json:"value"`
}

type ConnectionMappings

type ConnectionMappings []ConnectionMapping

func (*ConnectionMappings) Scan

func (m *ConnectionMappings) Scan(value interface{}) error

func (ConnectionMappings) Value

func (m ConnectionMappings) Value() (driver.Value, error)

type ConnectionTarget

type ConnectionTarget struct {
	Type ConnectionTargetType `json:"type"`
	Name string               `json:"name,omitempty"`
	// Used when Type is file, represents the path where the file should be mounted inside the container
	Path string `json:"path,omitempty"`
}

type ConnectionTargetType

type ConnectionTargetType string
const (
	ConnectionTargetTypeEnv  ConnectionTargetType = "env"
	ConnectionTargetTypeFile ConnectionTargetType = "file"
)

type ContainerFailureDetail

type ContainerFailureDetail struct {
	FailureType  string `json:"failure_type"`
	Reason       string `json:"reason,omitempty"`
	Message      string `json:"message,omitempty"`
	RestartCount int32  `json:"restart_count"`
	ExitCode     *int32 `json:"exit_code,omitempty"`
}

type Dependencies

type Dependencies []string

func (*Dependencies) Scan

func (d *Dependencies) Scan(value interface{}) error

func (Dependencies) Value

func (d Dependencies) Value() (driver.Value, error)

type DeployedClusterInfo

type DeployedClusterInfo struct {
	ClusterID string `json:"clusterId"`
	Namespace string `json:"namespace"`
}

type EnvSecretRef

type EnvSecretRef struct {
	SecretName string `json:"secret_name"`
	Key        string `json:"key"`
}

type EnvVar

type EnvVar struct {
	Name         string        `json:"name"`
	Value        string        `json:"value,omitempty"`
	SelfOutput   string        `json:"self_output,omitempty"`
	SecretKeyRef *EnvSecretRef `json:"secret_key_ref,omitempty"`
}

type EnvVars

type EnvVars []EnvVar

EnvVars is a top-level jsonb column of EnvVar entries (as opposed to ExecutionConfig.Env, which is serialized as part of its parent struct).

func (*EnvVars) Scan

func (e *EnvVars) Scan(value interface{}) error

func (EnvVars) Value

func (e EnvVars) Value() (driver.Value, error)

type ExecutionConfig

type ExecutionConfig struct {
	Command []string `json:"command,omitempty"`
	Args    []string `json:"args,omitempty"`
	Env     []EnvVar `json:"env,omitempty"`
}

func (*ExecutionConfig) Scan

func (ec *ExecutionConfig) Scan(value interface{}) error

func (ExecutionConfig) Value

func (ec ExecutionConfig) Value() (driver.Value, error)

type GCSCredentials

type GCSCredentials struct {
	ServiceAccountCredentials SecretReference `json:"serviceAccountCredentials"`
}

type GitAccountType

type GitAccountType string

GitAccountType is the kind of account a GitHub App is installed on.

const (
	GitAccountTypeUser         GitAccountType = "User"
	GitAccountTypeOrganization GitAccountType = "Organization"
)

GitHub account types as reported on installations.

type GitBuildSource

type GitBuildSource struct {
	RepoURL string `json:"repo_url"`
	// IntegrationID pins an org-level git integration for clone auth,
	// overriding host auto-attach. Resolution lands with git integrations.
	IntegrationID string `json:"integration_id,omitempty"`
}

type GitHubAppCredentials

type GitHubAppCredentials struct {
	AppID         int64  `json:"app_id"`
	Slug          string `json:"slug"`
	PEM           string `json:"pem"`
	WebhookSecret string `json:"webhook_secret"`
	ClientID      string `json:"client_id"`
	ClientSecret  string `json:"client_secret"`
}

GitHubAppCredentials are the app-level credentials returned by the GitHub App manifest conversion; stored encrypted in the integration's auth blob.

type GitHubAppManifestFlow

type GitHubAppManifestFlow struct {
	Manifest  map[string]any
	GitHubURL string
	State     string
}

GitHubAppManifestFlow is what the UI needs to send the user to GitHub's app-creation page.

type GitHubAppMintResult

type GitHubAppMintResult struct {
	IntegrationID string
	Host          string
	Token         string
	MintedAt      time.Time
	ExpiresAt     time.Time
	DataHash      string
}

GitHubAppMintResult is a freshly minted installation token plus the identity of the integration it came from.

type GitInstallation

type GitInstallation struct {
	ID                  string `gorm:"primary_key;default:gen_random_uuid()"`
	GitIntegrationID    string `gorm:"not null;index"`
	InstallationID      int64  `gorm:"not null"`
	AccountLogin        string `gorm:"not null"`
	AccountType         GitAccountType
	RepositorySelection string
	CreatedAt           time.Time
	UpdatedAt           time.Time
}

GitInstallation records a GitHub App installation on a GitHub account, linked to the org's github_app integration.

type GitIntegration

type GitIntegration struct {
	ID             string             `gorm:"primary_key;default:gen_random_uuid()"`
	OrganisationID string             `gorm:"not null;index"`
	Type           GitIntegrationType `gorm:"not null"`
	// Host is the git host this integration covers (required for
	// git_credentials; github.com for github_app).
	Host          string `gorm:"index"`
	EncryptedAuth string `gorm:"type:text"`
	Status        GitIntegrationStatus
	DataHash      string `gorm:"not null"` // for change detection / release freezing
	CreatedAt     time.Time
	UpdatedAt     time.Time

	// Transient decrypted auth; never stored or serialized.
	Auth *GitIntegrationAuth `gorm:"-" json:"-"`
	// Transient GitHub install URL for github_app integrations.
	InstallURL string `gorm:"-" json:"-"`
}

GitIntegration is an org-level git auth integration, auto-attached to repositories by host match when no explicit override is set.

type GitIntegrationAuth

type GitIntegrationAuth struct {
	Basic     *GitIntegrationBasicAuth `json:"basic,omitempty"`
	Token     string                   `json:"token,omitempty"`
	GitHubApp *GitHubAppCredentials    `json:"github_app,omitempty"`
}

GitIntegrationAuth is the decrypted auth blob for a git integration. Exactly one of Basic or Token is set for git_credentials integrations; github_app integrations carry app credentials instead (added with the GitHub App flow). SSH auth is deferred.

func (GitIntegrationAuth) Empty

func (a GitIntegrationAuth) Empty() bool

func (GitIntegrationAuth) Marshal

func (a GitIntegrationAuth) Marshal() ([]byte, error)

type GitIntegrationBasicAuth

type GitIntegrationBasicAuth struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

GitIntegrationBasicAuth is username/password clone auth.

type GitIntegrationStatus

type GitIntegrationStatus string
const (
	GitIntegrationStatusActive         GitIntegrationStatus = "active"
	GitIntegrationStatusPendingInstall GitIntegrationStatus = "pending_install"
	GitIntegrationStatusInstalled      GitIntegrationStatus = "installed"
)

type GitIntegrationType

type GitIntegrationType string
const (
	GitIntegrationTypeGitCredentials GitIntegrationType = "git_credentials"
	GitIntegrationTypeGitHubApp      GitIntegrationType = "github_app"
)

func (GitIntegrationType) Valid

func (t GitIntegrationType) Valid() bool

type GitRepoRevision

type GitRepoRevision struct {
	Branch string `json:"branch"`
	Tag    string `json:"tag"`
	Commit string `json:"commit"`
}

func (GitRepoRevision) IsValid

func (g GitRepoRevision) IsValid() bool

Valid

func (*GitRepoRevision) Scan

func (g *GitRepoRevision) Scan(value interface{}) error

func (GitRepoRevision) Type

func (GitRepoRevision) Value

func (g GitRepoRevision) Value() (driver.Value, error)

type GitRepoRevisionType

type GitRepoRevisionType string
const (
	Branch GitRepoRevisionType = "branch"
	Tag    GitRepoRevisionType = "tag"
	Commit GitRepoRevisionType = "commit"
)

type GitRepoSource

type GitRepoSource struct {
	RepoUrl  string          `json:"repo_url"`
	Revision GitRepoRevision `json:"revision"`
}

func (*GitRepoSource) Scan

func (g *GitRepoSource) Scan(value interface{}) error

func (GitRepoSource) Value

func (g GitRepoSource) Value() (driver.Value, error)

type GitRevision

type GitRevision struct {
	Branch string `json:"branch"`
	Tag    string `json:"tag"`
	Commit string `json:"commit"`
}

type ImageBuild

type ImageBuild struct {
	ID                string `gorm:"primary_key;default:gen_random_uuid()" json:"id"`
	Name              string `gorm:"not null; <-:create" json:"name"`
	Namespace         string
	StackID           string
	StackResourceID   string
	StackResourceName string
	StackResource     *StackResource    `gorm:"foreignKey:StackResourceID"`
	Spec              BuildConfigSpec   `gorm:"type:jsonb"`
	Status            *ImageBuildStatus `gorm:"type:jsonb"`
	CreatedAt         time.Time
	UpdatedAt         time.Time
}

type ImageBuildStatus

type ImageBuildStatus struct {
	Conditions             []Condition         `json:"conditions"`
	State                  string              `json:"state"`
	BuildSourceHash        string              `json:"build_source_hash"`
	ImageURL               string              `json:"image_url"`
	BuildSourceRevision    string              `json:"build_source_revision"`
	LastObservedStatusHash string              `json:"last_observed_status_hash,omitempty"`
	LastBuildFailureDetail *BuildFailureDetail `json:"last_build_failure_detail,omitempty"`
	// ReleaseID is the release that triggered this build: the agent copies the
	// parent StackResource's release-id annotation onto the ImageBuild at
	// creation, and builds are never mutated after that.
	ReleaseID string `json:"release_id,omitempty"`
}

func (*ImageBuildStatus) IsConditionTrue

func (s *ImageBuildStatus) IsConditionTrue(condType string) bool

IsConditionTrue reports whether the status carries the given condition type with status True, per the cluster-agent's condition vocabulary.

func (*ImageBuildStatus) Scan

func (w *ImageBuildStatus) Scan(value interface{}) error

Unmarhsal and marshal JSONB column types

func (ImageBuildStatus) Value

func (w ImageBuildStatus) Value() (driver.Value, error)

type ImageConfigSpec

type ImageConfigSpec struct {
	Image           string `json:"image"`
	ImagePullPolicy string `json:"image_pull_policy,omitempty"`
	// RegistryCredentialID pins an org-level registry credential for image
	// pulls, overriding host auto-attach.
	RegistryCredentialID string `json:"registry_credential_id,omitempty"`
}

func (*ImageConfigSpec) Scan

func (pc *ImageConfigSpec) Scan(value interface{}) error

func (ImageConfigSpec) Validate

func (i ImageConfigSpec) Validate() error

func (ImageConfigSpec) Value

func (pc ImageConfigSpec) Value() (driver.Value, error)

type ImageOverrides

type ImageOverrides map[string]string

ImageOverrides maps resource names to image references for preview stacks.

func (*ImageOverrides) Scan

func (o *ImageOverrides) Scan(value any) error

func (ImageOverrides) Value

func (o ImageOverrides) Value() (driver.Value, error)

type Ingress

type Ingress struct {
	URL        string `json:"url"`
	TargetPort int    `json:"target_port"`
}

type InitConfig

type InitConfig struct {
	Command []string `json:"command"`
	Args    []string `json:"args"`
}

func (*InitConfig) Scan

func (ic *InitConfig) Scan(value interface{}) error

func (InitConfig) Value

func (ic InitConfig) Value() (driver.Value, error)

type InviteStatus

type InviteStatus string
const (
	InviteStatusPending  InviteStatus = "pending"
	InviteStatusAccepted InviteStatus = "accepted"
	InviteStatusRevoked  InviteStatus = "revoked"
	InviteStatusExpired  InviteStatus = "expired"
)

type Label

type Label struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type Labels

type Labels []Label

func (*Labels) Scan

func (l *Labels) Scan(value interface{}) error

func (Labels) ToMap

func (l Labels) ToMap() map[string]string

Labels to map

func (Labels) Value

func (l Labels) Value() (driver.Value, error)

type LifecycleConfig

type LifecycleConfig struct {
	RestartRequestTime *time.Time `json:"restart_request_time"`
}

func (*LifecycleConfig) Scan

func (lc *LifecycleConfig) Scan(value interface{}) error

func (LifecycleConfig) Value

func (lc LifecycleConfig) Value() (driver.Value, error)

type Meta

type Meta struct {
	ID        string `gorm:"primary_key"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt gorm.DeletedAt `gorm:"index"`
}

type Namespace

type Namespace struct {
	ID             string      `gorm:"primary_key;default:gen_random_uuid()"`
	Name           string      `gorm:"not null;unique"`
	OrganisationID string      `gorm:"not null"`
	Labels         Labels      `gorm:"type:jsonb"`
	Annotations    Annotations `gorm:"type:jsonb"`
	CreatedAt      time.Time
	UpdatedAt      time.Time
}

func (*Namespace) AddDefaultLabels

func (n *Namespace) AddDefaultLabels()

func (*Namespace) AddSharedComputeTenantLabels

func (n *Namespace) AddSharedComputeTenantLabels(role string)

AddSharedComputeTenantLabels preserves the legacy cloud-tenant label because the hardening controller uses it to select tenant namespaces.

type NodeCapacity

type NodeCapacity struct {
	NodeName string             `json:"node_name"` // Name of the node
	CPU      *resource.Quantity `json:"cpu"`       // Total CPU capacity
	Memory   *resource.Quantity `json:"memory"`    // Total memory capacity
	Storage  *resource.Quantity `json:"storage"`   // Total storage capacity
}

type OAuthState

type OAuthState struct {
	ID          string    `gorm:"primary_key;default:gen_random_uuid()" json:"id"`
	State       string    `gorm:"not null;uniqueIndex" json:"state"`
	Provider    string    `gorm:"not null" json:"provider"`
	InviteToken string    `json:"inviteToken,omitempty"`
	CreatedAt   time.Time `gorm:"not null" json:"createdAt"`
}

func (OAuthState) TableName

func (OAuthState) TableName() string

type ObjectStore

type ObjectStore struct {
	ID             string `gorm:"primary_key;default:gen_random_uuid()"`
	OrganisationID string `gorm:"not null;index"`
	ProjectID      string `gorm:"index" json:"project_id"`
	Name           string `gorm:"not null"`

	// Spec fields
	Configuration   ObjectStoreConfiguration `gorm:"type:jsonb;not null"`
	DestinationPath string                   `gorm:"not null"`
	RetentionPolicy string

	// Status fields
	Status    ObjectStoreStatus `gorm:"type:jsonb"`
	CreatedAt time.Time
	UpdatedAt time.Time
}

type ObjectStoreConfiguration

type ObjectStoreConfiguration struct {
	S3Credentials    *S3Credentials    `json:"s3Credentials,omitempty"`
	AzureCredentials *AzureCredentials `json:"azureCredentials,omitempty"`
	GCSCredentials   *GCSCredentials   `json:"gcsCredentials,omitempty"`
}

func (*ObjectStoreConfiguration) Scan

func (c *ObjectStoreConfiguration) Scan(value interface{}) error

Implement driver.Valuer and sql.Scanner for custom types

func (ObjectStoreConfiguration) Value

type ObjectStoreStatus

type ObjectStoreStatus struct {
	State            string                `json:"state,omitempty"`
	Message          string                `json:"message,omitempty"`
	Conditions       []Condition           `json:"conditions,omitempty"`
	DeployedClusters []DeployedClusterInfo `json:"deployedClusters,omitempty"`
}

func (*ObjectStoreStatus) Scan

func (s *ObjectStoreStatus) Scan(value interface{}) error

func (ObjectStoreStatus) Value

func (s ObjectStoreStatus) Value() (driver.Value, error)

type OrgInvite

type OrgInvite struct {
	ID             string       `gorm:"primary_key;default:gen_random_uuid()" json:"id"`
	Email          string       `gorm:"not null" json:"email"`
	OrganisationID string       `gorm:"not null" json:"organisation_id"`
	ProjectID      string       `gorm:"not null" json:"project_id"`
	ProjectRole    ProjectRole  `gorm:"not null;column:project_role" json:"project_role"`
	TokenHash      string       `gorm:"not null" json:"-"`
	EncryptedToken string       `gorm:"not null" json:"-"`
	Status         InviteStatus `gorm:"not null;default:pending" json:"status"`
	ExpiresAt      time.Time    `gorm:"not null" json:"expires_at"`
	InvitedByID    string       `gorm:"not null" json:"invited_by_id"`
	AcceptedAt     *time.Time   `json:"accepted_at,omitempty"`
	EmailSent      bool         `gorm:"not null;default:false" json:"email_sent"`
	EmailSentAt    *time.Time   `json:"email_sent_at,omitempty"`
	EmailError     *string      `json:"email_error,omitempty"`
	CreatedAt      time.Time    `gorm:"not null" json:"created_at"`

	Organisation *Organisation `gorm:"foreignKey:OrganisationID" json:"organisation,omitempty"`
	Project      *Project      `gorm:"foreignKey:ProjectID" json:"project,omitempty"`
	InvitedBy    *User         `gorm:"foreignKey:InvitedByID" json:"invited_by,omitempty"`
}

type OrgInviteOperand

type OrgInviteOperand struct{ ID string }

type OrgRegistryDefaults

type OrgRegistryDefaults struct {
	StorageSize  string
	StorageClass string
}

OrgRegistryDefaults are install-level storage defaults for the registry seeded for each org at signup.

type Organisation

type Organisation struct {
	CreatedAt time.Time
	UpdatedAt time.Time
	ID        string `gorm:"primary_key;default:gen_random_uuid()" json:"id"`
	Name      string
	Platform  bool                  `gorm:"column:platform"`
	Domains   []*OrganisationDomain `gorm:"foreignKey:OrganisationID"`
}

type OrganisationDomain

type OrganisationDomain struct {
	ID             string `gorm:"primary_key;default:gen_random_uuid()" json:"id"`
	OrganisationID string `gorm:"not null"`
	Domain         string `gorm:"unique;not null"`
	CreatedAt      time.Time
	UpdatedAt      time.Time
}

type OutputDescriptor

type OutputDescriptor struct {
	Name      string          `json:"name"`
	Type      OutputValueType `json:"type"`
	Sensitive bool            `json:"sensitive"`
}

func PostgresAddonOutputDescriptors

func PostgresAddonOutputDescriptors(_ *PostgresAddon) []OutputDescriptor

func SecretOutputDescriptors

func SecretOutputDescriptors(secret *Secret) []OutputDescriptor

func StackResourceOutputDescriptors

func StackResourceOutputDescriptors(resource *StackResource) []OutputDescriptor

type OutputValueRef

type OutputValueRef struct {
	Output string `json:"output"`
}

type OutputValueType

type OutputValueType string
const (
	OutputValueTypeString  OutputValueType = "string"
	OutputValueTypeInteger OutputValueType = "integer"
	OutputValueTypeBoolean OutputValueType = "boolean"
)

type Port

type Port struct {
	Name                     string `json:"name"`
	Number                   int    `json:"number"`
	Protocol                 string `json:"protocol"`
	ExposedToPublic          bool   `json:"exposed_to_public"`
	SubdomainPrefix          string `json:"subdomain_prefix"`
	GeneratedSubdomainPrefix string `json:"generated_subdomain_prefix"`
	ExposedFqdn              string `json:"fqdn"`
}

type Ports

type Ports []Port

func (*Ports) Scan

func (p *Ports) Scan(value interface{}) error

func (Ports) Value

func (p Ports) Value() (driver.Value, error)

type PostgresAddon

type PostgresAddon struct {
	ID             string      `gorm:"primary_key;default:gen_random_uuid()"`
	OrganisationID string      `gorm:"not null;index"`
	ProjectID      string      `gorm:"index" json:"project_id"`
	UserID         string      `gorm:"not null;index"`
	ClusterID      string      `gorm:"not null;index"`
	Name           string      `gorm:"not null"`
	NamespaceID    string      `gorm:"not null;index"`
	Namespace      string      `gorm:"not null"`
	Labels         Labels      `gorm:"type:jsonb"`
	Annotations    Annotations `gorm:"type:jsonb"`
	Revision       string

	// Spec fields
	PostgresVersion PostgresVersion        `gorm:"type:jsonb;not null"`
	Instances       PostgresInstances      `gorm:"type:jsonb;not null"`
	Resources       PostgresResources      `gorm:"type:jsonb;not null"`
	Storage         PostgresStorage        `gorm:"type:jsonb;not null"`
	Configuration   PostgresConfiguration  `gorm:"type:jsonb"`
	Initialization  PostgresInitialization `gorm:"type:jsonb"`
	BackupConfig    PostgresBackupConfig   `gorm:"type:jsonb"`

	// Lifecycle fields
	BackupRequestedAt *time.Time              `gorm:"default:NULL"`
	LifecycleConfig   PostgresLifecycleConfig `gorm:"type:jsonb"`
	DeletionTimestamp *time.Time              `gorm:"default:NULL"`

	// Status fields
	Status    PostgresAddonStatus `gorm:"type:jsonb"`
	CreatedAt time.Time
	UpdatedAt time.Time

	// Relationships
	Databases []PostgresAddonDatabase `gorm:"foreignKey:PostgresAddonID"`
	Backups   []PostgresBackup        `gorm:"foreignKey:PostgresAddonID"`
	Outputs   []OutputDescriptor      `gorm:"-" json:"outputs,omitempty"`
}

func (PostgresAddon) AddonName

func (p PostgresAddon) AddonName() string

func (PostgresAddon) DefaultDatabaseSpecified

func (p PostgresAddon) DefaultDatabaseSpecified() bool

func (*PostgresAddon) EnsureDeclaredOutputs

func (p *PostgresAddon) EnsureDeclaredOutputs() []OutputDescriptor

func (*PostgresAddon) ExternalClusterRefName

func (p *PostgresAddon) ExternalClusterRefName() string

ExternalClusterRefName returns the identifier used in the PostgresCluster CR bootstrap import spec to reference the external database connection definition.

func (*PostgresAddon) HasDatabase

func (p *PostgresAddon) HasDatabase(name string) bool

func (*PostgresAddon) ImportPasswordSecretName

func (p *PostgresAddon) ImportPasswordSecretName() string

ImportPasswordSecretName returns the predictable K8s Secret name used to store the password for importing from an external database.

func (PostgresAddon) Type

func (p PostgresAddon) Type() string

type PostgresAddonClusterSecrets

type PostgresAddonClusterSecrets struct {
	SuperuserSecret     *string           `json:"superuserSecret,omitempty"`
	UserSecrets         map[string]string `json:"userSecrets,omitempty"`
	CACertificateSecret string            `json:"caCertificateSecret,omitempty"`
}

type PostgresAddonConditionType

type PostgresAddonConditionType string

PostgresAddonConditionType represents condition types for a PostgresAddon.

const (
	PostgresAddonConditionClusterConfigValid      PostgresAddonConditionType = "ClusterConfigurationValid"
	PostgresAddonConditionClusterReady            PostgresAddonConditionType = "ClusterReady"
	PostgresAddonConditionClusterHibernated       PostgresAddonConditionType = "ClusterHibernated"
	PostgresAddonConditionClusterFenced           PostgresAddonConditionType = "ClusterFenced"
	PostgresAddonConditionDatabasesApplied        PostgresAddonConditionType = "DatabasesApplied"
	PostgresAddonConditionWalArchivingSuccess     PostgresAddonConditionType = "ContinuousWalArchivingSuccess"
	PostgresAddonConditionLastBaseBackupSucceeded PostgresAddonConditionType = "LastBaseBackupSucceeded"

	// PostgresAddonConditionReadyOnce is set by the API server (not the cluster-agent)
	// when the addon first reaches Ready state. Once set, it is never cleared.
	PostgresAddonConditionReadyOnce PostgresAddonConditionType = "ReadyOnce"
)

type PostgresAddonConnectionInfo

type PostgresAddonConnectionInfo struct {
	Host           string                       `json:"host,omitempty"`
	Port           int32                        `json:"port,omitempty"`
	SSLMode        string                       `json:"sslMode,omitempty"`
	WriteService   string                       `json:"writeService,omitempty"`
	ReadService    string                       `json:"readService,omitempty"`
	ClusterSecrets *PostgresAddonClusterSecrets `json:"clusterSecrets,omitempty"`
}

type PostgresAddonDatabase

type PostgresAddonDatabase struct {
	ID              string             `gorm:"primary_key;default:gen_random_uuid()"`
	PostgresAddonID string             `gorm:"not null;index"`
	Name            string             `gorm:"not null"`
	Extensions      PostgresExtensions `gorm:"type:jsonb"`
	CreatedAt       time.Time
	UpdatedAt       time.Time
}

type PostgresAddonOperand

type PostgresAddonOperand struct{ ID string }

type PostgresAddonState

type PostgresAddonState string

PostgresAddonState represents the state of a PostgresAddon.

const (
	PostgresAddonStatePending      PostgresAddonState = "Pending"
	PostgresAddonStateCreating     PostgresAddonState = "Creating"
	PostgresAddonStateInitializing PostgresAddonState = "Initializing"
	PostgresAddonStateReady        PostgresAddonState = "Ready"
	PostgresAddonStateUpdating     PostgresAddonState = "Updating"
	PostgresAddonStateBackingUp    PostgresAddonState = "Backing Up"
	PostgresAddonStateRestoring    PostgresAddonState = "Restoring"
	PostgresAddonStateError        PostgresAddonState = "Error"
	PostgresAddonStateDeleting     PostgresAddonState = "Deleting"
	PostgresAddonStateHibernated   PostgresAddonState = "Hibernated"
	PostgresAddonStateFenced       PostgresAddonState = "Fenced"
)

type PostgresAddonStatus

type PostgresAddonStatus struct {
	State                  PostgresAddonState           `json:"state,omitempty"`
	Message                string                       `json:"message,omitempty"`
	Conditions             []Condition                  `json:"conditions,omitempty"`
	ConnectionInfo         *PostgresAddonConnectionInfo `json:"connectionInfo,omitempty"`
	Databases              []PostgresDatabaseInfo       `json:"databases,omitempty"`
	LastObservedStatusHash string                       `json:"lastObservedStatusHash,omitempty"`
}

func (*PostgresAddonStatus) Scan

func (s *PostgresAddonStatus) Scan(value interface{}) error

func (PostgresAddonStatus) Value

func (s PostgresAddonStatus) Value() (driver.Value, error)

type PostgresBackup

type PostgresBackup struct {
	ID              string `gorm:"primary_key;default:gen_random_uuid()"`
	PostgresAddonID string `gorm:"not null;index"`
	Name            string
	Description     string
	Type            PostgresBackupType
	Phase           string
	StartedAt       *time.Time
	CompletedAt     *time.Time
	Error           string
	SizeBytes       *int32
	CreatedAt       time.Time
	UpdatedAt       time.Time
}

type PostgresBackupConfig

type PostgresBackupConfig struct {
	ObjectStoreID string `json:"objectStoreId,omitempty"`
	Schedule      string `json:"schedule,omitempty"`
	WALArchiving  bool   `json:"walArchiving,omitempty"`
}

func (*PostgresBackupConfig) Scan

func (bc *PostgresBackupConfig) Scan(value interface{}) error

func (PostgresBackupConfig) Value

func (bc PostgresBackupConfig) Value() (driver.Value, error)

type PostgresBackupType

type PostgresBackupType string
const (
	PostgresBackupTypeManual    PostgresBackupType = "Manual"
	PostgresBackupTypeScheduled PostgresBackupType = "Scheduled"
)

type PostgresCPUResource

type PostgresCPUResource struct {
	Request string `json:"request"`
	Limit   string `json:"limit"`
}

type PostgresConfiguration

type PostgresConfiguration struct {
	EnableSuperuserAccess bool              `json:"enableSuperuserAccess,omitempty"`
	Parameters            map[string]string `json:"parameters,omitempty"`
}

func (*PostgresConfiguration) Scan

func (c *PostgresConfiguration) Scan(value interface{}) error

func (PostgresConfiguration) Value

func (c PostgresConfiguration) Value() (driver.Value, error)

type PostgresCredentials

type PostgresCredentials struct {
	Database         string `json:"database"`
	Host             string `json:"host"`
	Port             int32  `json:"port"`
	Username         string `json:"username"`
	Password         string `json:"password"`
	SSLMode          string `json:"sslMode"`
	ConnectionString string `json:"connectionString"`
	CACertificate    string `json:"caCertificate,omitempty"`
}

PostgresCredentials is the JIT-fetched credential response (not stored in DB)

func (*PostgresCredentials) ToOutputMap

func (c *PostgresCredentials) ToOutputMap() map[string]string

type PostgresDatabaseInfo

type PostgresDatabaseInfo struct {
	Name  string `json:"name"`
	Owner string `json:"owner,omitempty"`
}

type PostgresExtensions

type PostgresExtensions []string

Domain types for PostgreSQL addon

func (*PostgresExtensions) Scan

func (e *PostgresExtensions) Scan(value interface{}) error

func (PostgresExtensions) Value

func (e PostgresExtensions) Value() (driver.Value, error)

type PostgresImportFromExternal

type PostgresImportFromExternal struct {
	Host              string   `json:"host"`
	Port              int      `json:"port"`
	Database          string   `json:"database"`
	Username          string   `json:"username"`
	PasswordSecretID  string   `json:"passwordSecretId"`
	SslMode           *string  `json:"sslMode,omitempty"`
	DatabasesToImport []string `json:"databasesToImport,omitempty"`
}

type PostgresInitialization

type PostgresInitialization struct {
	RestoreFromBackup      *PostgresRestoreFromBackup      `json:"restoreFromBackup,omitempty"`
	RestoreFromObjectStore *PostgresRestoreFromObjectStore `json:"restoreFromObjectStore,omitempty"`
	ImportFromExternal     *PostgresImportFromExternal     `json:"importFromExternal,omitempty"`
}

func (*PostgresInitialization) Scan

func (i *PostgresInitialization) Scan(value interface{}) error

func (PostgresInitialization) Value

type PostgresInstancePlacement

type PostgresInstancePlacement struct {
	TopologyKey  string               `json:"topology_key,omitempty"`
	Policy       string               `json:"policy,omitempty"` // preferred or required
	NodeSelector map[string]string    `json:"node_selector,omitempty"`
	Tolerations  []PostgresToleration `json:"tolerations,omitempty"`
}

type PostgresInstances

type PostgresInstances struct {
	Count     int                        `json:"count"`
	Placement *PostgresInstancePlacement `json:"placement,omitempty"`
}

func (*PostgresInstances) Scan

func (i *PostgresInstances) Scan(value interface{}) error

func (PostgresInstances) Value

func (i PostgresInstances) Value() (driver.Value, error)

type PostgresLifecycleConfig

type PostgresLifecycleConfig struct {
	HibernationEnabled bool `json:"hibernationEnabled,omitempty"`
	FencingEnabled     bool `json:"fencingEnabled,omitempty"`
}

func (*PostgresLifecycleConfig) Scan

func (lc *PostgresLifecycleConfig) Scan(value interface{}) error

func (PostgresLifecycleConfig) Value

func (lc PostgresLifecycleConfig) Value() (driver.Value, error)

type PostgresMemoryResource

type PostgresMemoryResource struct {
	Request string `json:"request"`
	Limit   string `json:"limit"`
}

type PostgresResources

type PostgresResources struct {
	CPU    PostgresCPUResource    `json:"cpu"`
	Memory PostgresMemoryResource `json:"memory"`
}

func (*PostgresResources) Scan

func (r *PostgresResources) Scan(value interface{}) error

func (PostgresResources) Value

func (r PostgresResources) Value() (driver.Value, error)

type PostgresRestoreFromBackup

type PostgresRestoreFromBackup struct {
	BackupID string `json:"backupId"`
}

type PostgresRestoreFromObjectStore

type PostgresRestoreFromObjectStore struct {
	ObjectStoreID         string     `json:"objectStoreId"`
	SourcePostgresAddonID string     `json:"sourcePostgresAddonId"`
	RecoveryTargetTime    *time.Time `json:"recoveryTargetTime,omitempty"`
}

type PostgresStorage

type PostgresStorage struct {
	Size         string `json:"size"`
	StorageClass string `json:"storageClass,omitempty"`
}

func (*PostgresStorage) Scan

func (s *PostgresStorage) Scan(value interface{}) error

func (PostgresStorage) Value

func (s PostgresStorage) Value() (driver.Value, error)

type PostgresToleration

type PostgresToleration struct {
	Key      string `json:"key"`
	Operator string `json:"operator"`
	Value    string `json:"value,omitempty"`
	Effect   string `json:"effect"`
}

type PostgresVersion

type PostgresVersion struct {
	Major                     int  `json:"major"`
	Minor                     int  `json:"minor"`
	EnableMajorVersionUpgrade bool `json:"enableMajorVersionUpgrade,omitempty"`
	EnableMinorVersionUpgrade bool `json:"enableMinorVersionUpgrade,omitempty"`
}

func (*PostgresVersion) Scan

func (pv *PostgresVersion) Scan(value interface{}) error

Implement driver.Valuer and sql.Scanner for custom types

func (PostgresVersion) Value

func (pv PostgresVersion) Value() (driver.Value, error)

type PreviewGitRepository

type PreviewGitRepository struct {
	RepoURL    string `json:"repo_url"`
	BaseBranch string `json:"base_branch"`
	// IntegrationID pins an org-level git integration for clone auth;
	// otherwise clone auth follows host auto-match, then anonymous.
	IntegrationID string `json:"integration_id,omitempty"`
}

PreviewGitRepository holds the git configuration for a preview environment.

func (*PreviewGitRepository) Scan

func (r *PreviewGitRepository) Scan(value any) error

func (PreviewGitRepository) Value

func (r PreviewGitRepository) Value() (driver.Value, error)

type PreviewReconcilerStatus

type PreviewReconcilerStatus struct {
	LastAppliedCommitSHA     string    `json:"last_applied_commit_sha,omitempty"`
	LastAppliedStackfileHash string    `json:"last_applied_stackfile_hash,omitempty"`
	LastAppliedOverridesHash string    `json:"last_applied_overrides_hash,omitempty"`
	LastProcessedForceSyncAt time.Time `json:"last_processed_force_sync_at,omitempty"`
}

func (*PreviewReconcilerStatus) Scan

func (s *PreviewReconcilerStatus) Scan(value any) error

func (PreviewReconcilerStatus) Value

type PreviewStack

type PreviewStack struct {
	ID                   string `gorm:"primary_key;default:gen_random_uuid()"`
	OrganisationID       string `gorm:"not null"`
	ProjectID            string `gorm:"not null"`
	UserID               string `gorm:"not null"`
	StackPreviewConfigID string `gorm:"not null"`
	StackID              *string
	ActiveReleaseID      *string
	Name                 string                  `gorm:"not null"`
	PRNumber             string                  `gorm:"not null"`
	Branch               string                  `gorm:"not null"`
	CommitSHA            string                  `gorm:"not null"`
	Source               PreviewStackSource      `gorm:"not null"`
	GitHubCommentID      int64                   `gorm:"column:github_comment_id;not null;default:0"`
	GitHubCommentPending bool                    `gorm:"column:github_comment_pending;not null;default:false"`
	ImageOverrides       ImageOverrides          `gorm:"type:jsonb"`
	Labels               Labels                  `gorm:"type:jsonb"`
	Annotations          Annotations             `gorm:"type:jsonb"`
	Status               PreviewStackStatus      `gorm:"type:jsonb;not null"`
	ReconcilerStatus     PreviewReconcilerStatus `gorm:"type:jsonb;not null;default:'{}'"`
	ForceSyncRequestedAt *time.Time
	StackfileContent     *string
	DeletionTimestamp    *time.Time
	CreatedAt            time.Time
	UpdatedAt            time.Time
}

PreviewStack represents a preview environment spawned from a StackPreviewConfig.

func (PreviewStack) TableName

func (PreviewStack) TableName() string

type PreviewStackOperand

type PreviewStackOperand struct{ ID string }

type PreviewStackOutputs

type PreviewStackOutputs struct {
	CommitSHA string       `json:"commit_sha,omitempty"`
	URLs      []PreviewURL `json:"urls,omitempty"`
}

PreviewStackOutputs holds deployment outputs for a preview stack.

type PreviewStackPhase

type PreviewStackPhase string

PreviewStackPhase represents the lifecycle phase of a preview stack.

const (
	PreviewStackPhaseProvisioning PreviewStackPhase = "Provisioning"
	PreviewStackPhaseDeploying    PreviewStackPhase = "Deploying"
	PreviewStackPhaseReady        PreviewStackPhase = "Ready"
	PreviewStackPhaseFailed       PreviewStackPhase = "Failed"
	PreviewStackPhaseDeleting     PreviewStackPhase = "Deleting"
)

type PreviewStackSource

type PreviewStackSource string

PreviewStackSource indicates how a preview stack was created.

const (
	PreviewStackSourceManual  PreviewStackSource = "manual"
	PreviewStackSourceWebhook PreviewStackSource = "webhook"
)

type PreviewStackStatus

type PreviewStackStatus struct {
	Phase   PreviewStackPhase    `json:"phase"`
	Reason  string               `json:"reason,omitempty"`
	Message string               `json:"message,omitempty"`
	Outputs *PreviewStackOutputs `json:"outputs,omitempty"`
}

PreviewStackStatus holds the current status of a preview stack.

func (*PreviewStackStatus) Scan

func (s *PreviewStackStatus) Scan(value any) error

func (PreviewStackStatus) Value

func (s PreviewStackStatus) Value() (driver.Value, error)

type PreviewURL

type PreviewURL struct {
	Resource string `json:"resource"`
	URL      string `json:"url"`
}

PreviewURL maps a resource name to its public URL.

type Project

type Project struct {
	ID             string `gorm:"primary_key;default:gen_random_uuid()" json:"id"`
	Name           string `gorm:"not null" json:"name"`
	OrganisationID string `gorm:"not null" json:"organisation_id"`
	DefaultProject bool   `gorm:"not null;default:false" json:"default_project"`
	CreatedAt      time.Time
	UpdatedAt      time.Time
}

type ProjectMembership

type ProjectMembership struct {
	ID        string      `gorm:"primary_key;default:gen_random_uuid()" json:"id"`
	ProjectID string      `gorm:"not null" json:"project_id"`
	UserID    string      `gorm:"not null" json:"user_id"`
	Role      ProjectRole `gorm:"not null" json:"role"`
	CreatedAt time.Time
	Project   *Project `gorm:"foreignKey:ProjectID" json:"project,omitempty"`
	User      *User    `gorm:"foreignKey:UserID" json:"user,omitempty"`
}

type ProjectRole

type ProjectRole string
const (
	DeveloperRole ProjectRole = "Developer"
	ViewerRole    ProjectRole = "Viewer"
)

func (ProjectRole) String

func (r ProjectRole) String() string

type ReferentType

type ReferentType string
const (
	ReferentSecret             ReferentType = "secret"
	ReferentVolume             ReferentType = "volume"
	ReferentPostgresAddon      ReferentType = "postgres_addon"
	ReferentRegistryCredential ReferentType = "registry_credential"
	ReferentGitIntegration     ReferentType = "git_integration"
)

type RefreshToken

type RefreshToken struct {
	ID        string     `gorm:"primary_key;default:gen_random_uuid()" json:"id"`
	UserID    string     `gorm:"not null" json:"userId"`
	TokenHash string     `gorm:"not null" json:"-"`
	ExpiresAt time.Time  `gorm:"not null" json:"expiresAt"`
	CreatedAt time.Time  `gorm:"not null" json:"createdAt"`
	RevokedAt *time.Time `json:"revokedAt,omitempty"`
}

func (RefreshToken) TableName

func (RefreshToken) TableName() string

type RegistryCredential

type RegistryCredential struct {
	ID                string                    `gorm:"primary_key;default:gen_random_uuid()"`
	OrganisationID    string                    `gorm:"not null;index"`
	Host              string                    `gorm:"not null"` // normalized registry host
	Purpose           RegistryCredentialPurpose `gorm:"not null;default:'both'"`
	Username          string                    `gorm:"not null"`
	EncryptedPassword string                    `gorm:"type:text;not null"`
	DataHash          string                    `gorm:"not null"` // for change detection / release freezing
	CreatedAt         time.Time
	UpdatedAt         time.Time

	// Transient plaintext password; never stored or serialized.
	Password string `gorm:"-" json:"-"`
}

RegistryCredential is an org-level credential for a container registry host, auto-attached by host match when no explicit per-resource credential is set.

type RegistryCredentialPurpose

type RegistryCredentialPurpose string
const (
	RegistryCredentialPurposePull RegistryCredentialPurpose = "pull"
	RegistryCredentialPurposePush RegistryCredentialPurpose = "push"
	RegistryCredentialPurposeBoth RegistryCredentialPurpose = "both"
)

func (RegistryCredentialPurpose) ConflictsWith

ConflictsWith reports whether two credentials for the same (org, host) pair overlap: 'both' conflicts with everything, otherwise only exact duplicates conflict.

func (RegistryCredentialPurpose) Covers

Covers reports whether a credential with purpose p can be used for the requested purpose.

func (RegistryCredentialPurpose) Valid

func (p RegistryCredentialPurpose) Valid() bool

type RegistryState

type RegistryState string
const (
	RegistryStatePending  RegistryState = "Pending"
	RegistryStateRunning  RegistryState = "Running"
	RegistryStateError    RegistryState = "Error"
	RegistryStateDeleting RegistryState = "Deleting"
)

type RelationKind

type RelationKind string
const (
	RelationEnv           RelationKind = "env"
	RelationVolumeMount   RelationKind = "volume_mount"
	RelationBuildArtifact RelationKind = "build_artifact_source"
	RelationGitCredential RelationKind = "git_credential"
	RelationImagePull     RelationKind = "image_pull"
	RelationImagePush     RelationKind = "image_push"
)

type ReleaseCause

type ReleaseCause struct {
	Kind   ReleaseCauseKind `json:"kind"`
	Detail string           `json:"detail,omitempty"`
}

func (*ReleaseCause) Scan

func (c *ReleaseCause) Scan(value interface{}) error

func (ReleaseCause) Value

func (c ReleaseCause) Value() (driver.Value, error)

type ReleaseCauseKind

type ReleaseCauseKind string
const (
	ReleaseCauseManual      ReleaseCauseKind = "manual"
	ReleaseCauseRollback    ReleaseCauseKind = "rollback"
	ReleaseCauseWebhookPush ReleaseCauseKind = "webhook_push"
	ReleaseCausePreviewSync ReleaseCauseKind = "preview_sync"
)

type ReleaseEvent

type ReleaseEvent struct {
	ID           string             `gorm:"primaryKey;default:gen_random_uuid()"`
	ReleaseID    string             `gorm:"not null"`
	StackID      string             `gorm:"not null"`
	Sequence     int                `gorm:"not null"`
	OccurredAt   time.Time          `gorm:"not null;default:now()"`
	Source       ReleaseEventSource `gorm:"not null"`
	Scope        ReleaseEventScope  `gorm:"not null"`
	ResourceName *string
	Type         ReleaseEventType     `gorm:"not null"`
	Level        ReleaseEventLevel    `gorm:"not null"`
	Message      string               `gorm:"not null"`
	DedupeKey    string               `gorm:"not null"`
	Links        ReleaseEventLinks    `gorm:"type:jsonb"`
	Metadata     ReleaseEventMetadata `gorm:"type:jsonb"`
	CreatedAt    time.Time
}

func (ReleaseEvent) TableName

func (ReleaseEvent) TableName() string

type ReleaseEventLevel

type ReleaseEventLevel string
const (
	ReleaseEventLevelInfo    ReleaseEventLevel = "info"
	ReleaseEventLevelSuccess ReleaseEventLevel = "success"
	ReleaseEventLevelWarning ReleaseEventLevel = "warning"
	ReleaseEventLevelError   ReleaseEventLevel = "error"
)
type ReleaseEventLink struct {
	Kind   string            `json:"kind"`
	Label  string            `json:"label"`
	Target map[string]string `json:"target"`
}
type ReleaseEventLinks []ReleaseEventLink

func (*ReleaseEventLinks) Scan

func (l *ReleaseEventLinks) Scan(value interface{}) error

func (ReleaseEventLinks) Value

func (l ReleaseEventLinks) Value() (driver.Value, error)

type ReleaseEventMetadata

type ReleaseEventMetadata map[string]string

func (*ReleaseEventMetadata) Scan

func (m *ReleaseEventMetadata) Scan(value interface{}) error

func (ReleaseEventMetadata) Value

func (m ReleaseEventMetadata) Value() (driver.Value, error)

type ReleaseEventScope

type ReleaseEventScope string
const (
	ReleaseEventScopeRelease  ReleaseEventScope = "release"
	ReleaseEventScopeResource ReleaseEventScope = "resource"
)

type ReleaseEventSource

type ReleaseEventSource string
const (
	ReleaseEventSourceHub     ReleaseEventSource = "hub"
	ReleaseEventSourceCluster ReleaseEventSource = "cluster"
)

type ReleaseEventType

type ReleaseEventType string
const (
	ReleaseEventTypeReleaseCreated       ReleaseEventType = "release_created"
	ReleaseEventTypeReleaseChecksStarted ReleaseEventType = "release_checks_started"
	ReleaseEventTypeReleaseCheckFailed   ReleaseEventType = "release_check_failed"
	ReleaseEventTypeReleaseChecksPassed  ReleaseEventType = "release_checks_passed"
	ReleaseEventTypeReleaseStarted       ReleaseEventType = "release_started"
	ReleaseEventTypeBuildQueued          ReleaseEventType = "build_queued" // reserved; not emitted in v1
	ReleaseEventTypeBuildStarted         ReleaseEventType = "build_started"
	ReleaseEventTypeBuildSucceeded       ReleaseEventType = "build_succeeded"
	// ReleaseEventTypeBuildAttemptFailed: a build attempt errored but the build
	// job is still retrying (ImageBuild phase stays Pending until the job's
	// backoff limit is exhausted).
	ReleaseEventTypeBuildAttemptFailed ReleaseEventType = "build_attempt_failed"
	ReleaseEventTypeBuildFailed        ReleaseEventType = "build_failed"
	ReleaseEventTypeResourceWaiting    ReleaseEventType = "resource_waiting"
	ReleaseEventTypeResourceDeploying  ReleaseEventType = "resource_deploying"
	ReleaseEventTypeResourceReady      ReleaseEventType = "resource_ready"
	ReleaseEventTypeResourceFailed     ReleaseEventType = "resource_failed"
	// ReleaseEventTypeResourcePortsClosed: the rollout landed but a declared
	// port is not accepting connections.
	ReleaseEventTypeResourcePortsClosed ReleaseEventType = "resource_ports_closed"
	ReleaseEventTypeResourceTLSIssuing  ReleaseEventType = "resource_tls_issuing"
	ReleaseEventTypeResourceTLSReady    ReleaseEventType = "resource_tls_ready"
	ReleaseEventTypeResourceTLSFailed   ReleaseEventType = "resource_tls_failed"
	ReleaseEventTypeReleaseReleased     ReleaseEventType = "release_released"
	ReleaseEventTypeReleaseFailed       ReleaseEventType = "release_failed"
	ReleaseEventTypeReleaseSuperseded   ReleaseEventType = "release_superseded"
	ReleaseEventTypeReleaseCancelled    ReleaseEventType = "release_cancelled"
)

type ReleaseHealth

type ReleaseHealth string

ReleaseHealth is the computed runtime rollup for a live/active release.

const (
	ReleaseHealthOK          ReleaseHealth = "ok"
	ReleaseHealthProgressing ReleaseHealth = "progressing"
	ReleaseHealthDegraded    ReleaseHealth = "degraded"
	ReleaseHealthUnavailable ReleaseHealth = "unavailable"
	ReleaseHealthFailed      ReleaseHealth = "failed"
)

type ReleaseLiveStatus

type ReleaseLiveStatus struct {
	Health           ReleaseHealth
	Resources        map[string]*StackResourceStatus
	Conditions       []Condition
	TargetRevision   string
	ObservedRevision string
}

ReleaseLiveStatus is a read-time overlay: current stack/resource status attributed to a release. Never persisted.

func BuildReleaseLiveStatus

func BuildReleaseLiveStatus(release *StackRelease, stack *Stack) *ReleaseLiveStatus

BuildReleaseLiveStatus overlays current stack/resource status onto a release. Returns nil unless the release is active (Pending/InProgress) or live (the stack's last converged release).

type ReleaseManifest

type ReleaseManifest struct {
	StackCR            json.RawMessage                  `json:"stack_cr"`
	StackResourceCRs   map[string]json.RawMessage       `json:"stack_resource_crs"`
	ResourceNames      []string                         `json:"resource_names"`
	VolumeBuildSources map[string][]BuildArtifactSource `json:"volume_build_sources,omitempty"`
	ResourceRevisions  map[string]string                `json:"resource_revisions"`
}

ReleaseManifest holds the rendered Kubernetes CRs produced by the renderer. Once written it is immutable (enforced by a DB trigger).

func (*ReleaseManifest) Scan

func (m *ReleaseManifest) Scan(value interface{}) error

func (ReleaseManifest) Value

func (m ReleaseManifest) Value() (driver.Value, error)

type ReleaseOutcome

type ReleaseOutcome struct {
	Resources map[string]ResourceOutcome `json:"resources,omitempty"`
	Duration  time.Duration              `json:"duration"`
}

ReleaseOutcome records per-resource convergence results.

func (*ReleaseOutcome) Scan

func (o *ReleaseOutcome) Scan(value interface{}) error

func (ReleaseOutcome) Value

func (o ReleaseOutcome) Value() (driver.Value, error)

type ReleasePins

type ReleasePins struct {
	// Resource Name -> Resolved artifact src.
	Resources map[string]ResourcePins `json:"resources,omitempty"`
}

ReleasePins captures the resolved artifact coordinates for each resource.

func (*ReleasePins) Scan

func (p *ReleasePins) Scan(value interface{}) error

func (ReleasePins) Value

func (p ReleasePins) Value() (driver.Value, error)

type ReleaseSummary

type ReleaseSummary struct {
	ID       string
	Sequence int
	State    StackReleaseState
}

ReleaseSummary is a lightweight projection used for release GC decisions.

type ReleaseValidationError

type ReleaseValidationError struct {
	ResourceName string `json:"resource_name"`
	Field        string `json:"field"`
	Code         string `json:"code"`
	Message      string `json:"message"`
}

ReleaseValidationError is one structured validation failure attached to a release, addressed to a resource and a field of its spec.

type ReleaseValidationErrors

type ReleaseValidationErrors []ReleaseValidationError

func (*ReleaseValidationErrors) Scan

func (v *ReleaseValidationErrors) Scan(value interface{}) error

func (ReleaseValidationErrors) Value

type ReleaseWorkerStatus

type ReleaseWorkerStatus struct {
	// ConvergeClockStartedAt is when the convergence timeout clock started.
	// The deadline reconciler stamps it once the release has no builds left
	// to wait for, and clears it again if a build shows up running. Nil means
	// the clock has not started and the release cannot converge-timeout.
	ConvergeClockStartedAt *time.Time `json:"converge_clock_started_at,omitempty"`
}

ReleaseWorkerStatus is bookkeeping the release worker persists while a release is in flight. It is not part of the user-facing release contract.

func (*ReleaseWorkerStatus) Scan

func (w *ReleaseWorkerStatus) Scan(value interface{}) error

func (ReleaseWorkerStatus) Value

func (w ReleaseWorkerStatus) Value() (driver.Value, error)

type RemoteDirSource

type RemoteDirSource struct {
	// Path within the client where the directory to be synced is located.
	Path string `json:"path"`
	// We use this to track the current state of the remote directory.
	CurrentDirectoryHash string `json:"current_directory_hash"`
}

func (*RemoteDirSource) Scan

func (l *RemoteDirSource) Scan(value interface{}) error

func (RemoteDirSource) Value

func (l RemoteDirSource) Value() (driver.Value, error)

type ResourceMetrics

type ResourceMetrics struct {
	AssignedNodes  []string          `json:"assigned_node"` // Node where the resource is assigned
	CPUUsage       resource.Quantity `json:"cpu_usage"`     // CPU usage in percentage
	CPULimit       resource.Quantity `json:"cpu_limit"`     // CPU limit in cores
	MemoryUsage    resource.Quantity `json:"memory_usage"`  // Memory usage in percentage
	MemoryLimit    resource.Quantity `json:"memory_limit"`  // Memory limit in bytes
	NetworkIO      float64           `json:"network_io"`    // Network I/O in bytes
	StorageIO      float64           `json:"storage_io"`    // Storage I/O in bytes
	NodeCapacities []*NodeCapacity   `json:"node_capacity"` // Node capacity metrics
	TimeStamp      time.Time         `json:"time_stamp"`    // Timestamp of the metrics
}

type ResourceOutcome

type ResourceOutcome struct {
	Phase         StackResourcePhase `json:"phase"`
	ReadyReplicas int32              `json:"ready_replicas"`
	Replicas      int32              `json:"replicas"`
	Message       string             `json:"message,omitempty"`
}

ResourceOutcome tracks the final state of a single resource in a release.

type ResourcePins

type ResourcePins struct {
	GitSHA string `json:"git_sha,omitempty"`
	// Branch records the branch a default-branch resolution landed on, so the
	// snapshot can carry it (the CRD requires branch-or-tag on git revisions).
	Branch      string `json:"branch,omitempty"`
	VolumeHash  string `json:"volume_hash,omitempty"`
	ImageDigest string `json:"image_digest,omitempty"`
}

ResourcePins holds the pinned artifact identifiers for a single resource.

type ResourceReference

type ResourceReference struct {
	ID           string       `gorm:"primary_key;default:gen_random_uuid()"`
	StackID      string       `gorm:"not null;index"`
	ReleaseID    *string      `gorm:"index"` // nil => live spec
	ReferentType ReferentType `gorm:"not null"`
	ReferentID   string       `gorm:"not null"`
	RelationKind RelationKind `gorm:"not null"`
	CreatedAt    time.Time
}

ResourceReference is a derived index row: a scope (the live stack spec when ReleaseID is nil, or a specific release) references a deletable referent.

func (ResourceReference) TableName

func (ResourceReference) TableName() string

type ResourceValidationCheckKind

type ResourceValidationCheckKind string

ResourceValidationCheckKind names an expensive release-time check.

const (
	ValidationCheckImagePull  ResourceValidationCheckKind = "image_pull"
	ValidationCheckPushAccess ResourceValidationCheckKind = "push_access"
)

type ResourceValidationRecord

type ResourceValidationRecord struct {
	StackID      string                      `gorm:"primaryKey"`
	ResourceName string                      `gorm:"primaryKey"`
	CheckKind    ResourceValidationCheckKind `gorm:"primaryKey"`
	Fingerprint  string                      `gorm:"not null"`
	ValidatedAt  time.Time                   `gorm:"not null"`
}

ResourceValidationRecord remembers the last successful expensive validation for a resource so unchanged targets are not re-probed on every release. Failures are never recorded.

func (ResourceValidationRecord) TableName

func (ResourceValidationRecord) TableName() string

type S3Credentials

type S3Credentials struct {
	AccessKeyID     SecretReference `json:"accessKeyId"`
	SecretAccessKey SecretReference `json:"secretAccessKey"`
	Region          string          `json:"region"`
	Endpoint        string          `json:"endpoint,omitempty"`
}

type SSHConfig

type SSHConfig struct {
	// Users public key.
	PublicKey string `json:"public_key"`
}

func (*SSHConfig) Scan

func (c *SSHConfig) Scan(value interface{}) error

func (SSHConfig) Value

func (c SSHConfig) Value() (driver.Value, error)

type Secret

type Secret struct {
	ID             string `gorm:"primary_key;default:gen_random_uuid()"`
	OrganisationID string `gorm:"not null;index"`
	ProjectID      string `gorm:"index" json:"project_id"`
	UserID         string `gorm:"not null;index"`
	Name           string `gorm:"not null"`
	Description    string
	Type           SecretType `gorm:"not null" json:"type"`
	EncryptedData  string     `gorm:"type:text;not null"`
	Keys           SecretKeys `gorm:"type:jsonb" json:"keys"`
	DataHash       string     `gorm:"not null" ` // For change detection

	CreatedAt time.Time
	UpdatedAt time.Time

	// Transient field for API responses (not stored in DB)
	Data    map[string]string  `gorm:"-" json:"data,omitempty"`
	Outputs []OutputDescriptor `gorm:"-" json:"outputs,omitempty"`
}

func (*Secret) ClusterSecretName

func (s *Secret) ClusterSecretName() string

func (*Secret) EnsureDeclaredOutputs

func (s *Secret) EnsureDeclaredOutputs() []OutputDescriptor

func (*Secret) ToOutputMap

func (s *Secret) ToOutputMap() map[string]string

type SecretKeys

type SecretKeys []string

func (*SecretKeys) Scan

func (s *SecretKeys) Scan(value interface{}) error

func (SecretKeys) Value

func (s SecretKeys) Value() (driver.Value, error)

type SecretReference

type SecretReference struct {
	SecretID string `json:"secret_id"` // UUID of the secret
	Key      string `json:"key"`       // Key within the secret
}

SecretReference points to a secret and an optional key within that secret.

type SecretType

type SecretType string
const (
	SecretTypeGeneric          SecretType = "Generic"
	SecretTypeDockerRegistry   SecretType = "DockerRegistry"
	SecretTypeGitCredentials   SecretType = "GitCredentials"
	SecretTypeUsernamePassword SecretType = "UsernamePassword"
	SecretTypeToken            SecretType = "Token"
	SecretTypeSSHKey           SecretType = "SSHKey"
)

type SourceVolumeType

type SourceVolumeType string
const (
	EmptyVolume               SourceVolumeType = "EmptyVolume"
	RemoteDirSyncedVolume     SourceVolumeType = "RemoteDirSyncedVolume"
	BuildArtifactSyncedVolume SourceVolumeType = "BuildArtifactSyncedVolume"
	GitRepoVolume             SourceVolumeType = "GitRepoVolume"
)

type Stack

type Stack struct {
	ID                string      `gorm:"primary_key;default:gen_random_uuid()" json:"id"`
	OrganisationID    string      `gorm:"not null"`
	ProjectID         string      `gorm:"index" json:"project_id"`
	ClusterID         string      `gorm:"not null"`
	UserID            string      `gorm:"not null"`
	Name              string      `gorm:"not null;<-:create"`
	NamespaceID       string      `gorm:"not null"`
	Namespace         string      `gorm:"unique;not null;<-:create"`
	Labels            Labels      `gorm:"type:jsonb"`
	Annotations       Annotations `gorm:"type:jsonb"`
	CrRevision        string
	Connections       StackConnections `gorm:"-"`
	StackResources    []*StackResource `gorm:"foreignKey:StackID"`
	Volumes           []*Volume        `gorm:"-"`
	Status            *StackStatus     `gorm:"type:jsonb"`
	Settings          *StackSettings   `gorm:"type:jsonb"`
	CreatedAt         time.Time
	UpdatedAt         time.Time
	DeletionTimestamp *time.Time `gorm:"default:NULL"`
}

func (*Stack) DirectConfigSecretsInUse

func (ws *Stack) DirectConfigSecretsInUse() []string

func (*Stack) EffectiveSettings

func (s *Stack) EffectiveSettings() StackSettings

func (*Stack) ExposedPortFqdnMap

func (s *Stack) ExposedPortFqdnMap() map[string]map[int]string

func (*Stack) GetConvergedReleaseID

func (s *Stack) GetConvergedReleaseID() string

func (*Stack) GetGitCredentialsMap

func (s *Stack) GetGitCredentialsMap() map[string]string

func (*Stack) GetImagePullSecretIDMap

func (s *Stack) GetImagePullSecretIDMap() map[string]string

returns a map of image names to their pull secret IDs

func (*Stack) GetImagePushSecretIDMap

func (s *Stack) GetImagePushSecretIDMap() map[string]string

GetImagePushSecretIDMap returns a map of resource names to their push secret IDs.

func (*Stack) HasConvergedRelease

func (s *Stack) HasConvergedRelease() bool

func (*Stack) HasExposedPorts

func (s *Stack) HasExposedPorts() bool

func (*Stack) HasGitCredentials

func (s *Stack) HasGitCredentials() bool

func (*Stack) HasImageBuilds

func (s *Stack) HasImageBuilds() bool

hasImageBuilds

func (*Stack) HasImagePullSecrets

func (s *Stack) HasImagePullSecrets() bool

func (*Stack) HasImagePushSecrets

func (s *Stack) HasImagePushSecrets() bool

HasImagePushSecrets checks if any stack resource has an image push secret configured.

func (*Stack) HasVolumeMounts

func (ws *Stack) HasVolumeMounts() bool

func (*Stack) ResourcesMap

func (ws *Stack) ResourcesMap() map[string]*StackResource

func (*Stack) SecretsInUse

func (ws *Stack) SecretsInUse() []string

func (*Stack) VolumeMountIds

func (ws *Stack) VolumeMountIds() []string

func (*Stack) VolumesMap

func (ws *Stack) VolumesMap() map[string]*Volume

type StackConditionType

type StackConditionType string
const (
	StackConditionAvailable      StackConditionType = "Available"
	StackConditionConverged      StackConditionType = "Converged"
	StackConditionResourcesReady StackConditionType = "ResourcesReady"
	StackConditionStalled        StackConditionType = "Stalled"
	StackConditionDegraded       StackConditionType = "Degraded"
	StackConditionProgressing    StackConditionType = "Progressing"
)

type StackConnection

type StackConnection struct {
	ID            string             `json:"id" gorm:"column:id;primary_key;default:gen_random_uuid()"`
	StackID       string             `json:"-" gorm:"not null;index"`
	Kind          ConnectionKind     `json:"kind" gorm:"not null"`
	From          TopologyNodeRef    `json:"from" gorm:"column:from_ref;type:jsonb;not null"`
	To            TopologyNodeRef    `json:"to" gorm:"column:to_ref;type:jsonb;not null"`
	Mappings      ConnectionMappings `json:"mappings,omitempty" gorm:"type:jsonb"`
	Config        ConnectionConfig   `json:"config,omitempty" gorm:"type:jsonb"`
	Discriminator string             `json:"-" gorm:"not null;default:''"`
	CreatedAt     time.Time          `json:"-"`
	UpdatedAt     time.Time          `json:"-"`
}

StackConnection represents a directed edge between two topology nodes in a stack.

The unique constraint on (stack_id, kind, from_ref, to_ref, discriminator) prevents duplicate edges. The Discriminator field is a config-derived scoping key that allows multiple connections between the same (from, to) pair when they target different logical sub-resources — e.g., two env connections from the same PostgresAddon to the same stack resource, each targeting a different database. For connection types that don't need sub-resource scoping, the discriminator is an empty string and the constraint behaves like a simple (stack_id, kind, from_ref, to_ref) unique index.

To extend discriminator support for new connection types, add a case to ComputeDiscriminator(). The store layer calls it automatically before persistence.

func (*StackConnection) ComputeDiscriminator

func (c *StackConnection) ComputeDiscriminator() string

ComputeDiscriminator derives a scoping key from the connection's config based on the source type and kind. This allows the unique index to permit multiple connections between the same (from, to) pair when they address different sub-resources.

Currently supported:

  • addon/postgres + env → config.database (allows wiring multiple databases from one addon)

Returns "" for all other connection types, preserving standard edge uniqueness.

func (StackConnection) ConfigBool

func (c StackConnection) ConfigBool(key string) (bool, bool, error)

func (StackConnection) ConfigString

func (c StackConnection) ConfigString(key string) (string, bool, error)

func (StackConnection) IsKind

func (c StackConnection) IsKind(kind ConnectionKind) bool

func (StackConnection) RequiredConfigString

func (c StackConnection) RequiredConfigString(key string) (string, error)

func (StackConnection) SourceIs

func (c StackConnection) SourceIs(nodeType TopologyNodeType) bool

func (StackConnection) TableName

func (StackConnection) TableName() string

func (StackConnection) TargetIs

func (c StackConnection) TargetIs(nodeType TopologyNodeType) bool

func (StackConnection) TargetsStackResource

func (c StackConnection) TargetsStackResource(resourceName string) bool

type StackConnections

type StackConnections []StackConnection

func (StackConnections) EnvForStackResource

func (connections StackConnections) EnvForStackResource(resourceName string) StackConnections

func (StackConnections) FromType

func (connections StackConnections) FromType(sourceType TopologyNodeType) StackConnections

func (StackConnections) HasAnyKind

func (connections StackConnections) HasAnyKind(kinds ...ConnectionKind) bool

func (StackConnections) OfKind

func (connections StackConnections) OfKind(kind ConnectionKind) StackConnections

func (*StackConnections) Scan

func (c *StackConnections) Scan(value interface{}) error

func (StackConnections) Value

func (c StackConnections) Value() (driver.Value, error)

type StackConvergenceRecord

type StackConvergenceRecord struct {
	Revision  string    `json:"revision"`
	ReleaseID string    `json:"release_id,omitempty"`
	At        time.Time `json:"at"`
}

type StackDomain

type StackDomain struct {
	ID                string `gorm:"primary_key;default:gen_random_uuid()" json:"id"`
	OrganisationID    string `gorm:"not null"`
	Fqdn              string `gorm:"unique;not null"`
	StackID           string `gorm:"not null;index"`
	StackResourceID   string `gorm:"not null;index"`
	StackResourceName string `gorm:"not null"`
	TargetPort        int    `gorm:"not null"`
	CreatedAt         time.Time
	UpdatedAt         time.Time
}

type StackDomainList

type StackDomainList []*StackDomain

func (*StackDomainList) FindByFqdn

func (d *StackDomainList) FindByFqdn(fqdn string) *StackDomain

func (*StackDomainList) FqdnPresent

func (d *StackDomainList) FqdnPresent(fqdn string) bool

type StackOperand

type StackOperand struct{ ID string }

Workqueue operands. Must be comparable values, never pointers:

  • the workqueue dedups and rate-limits by map-key equality,
  • a pointer's map key is its address, so every allocation looks like new work and duplicates accumulate for long-running operands,
  • value keys also guarantee no two goroutines process the same operand concurrently once workers run with multiple goroutines.

type StackPhase

type StackPhase string

StackPhase mirrors the cluster-agent's phase vocabulary for API-facing typed enums.

const (
	StackPhaseReady       StackPhase = "Ready"
	StackPhasePending     StackPhase = "Pending"
	StackPhaseFailed      StackPhase = "Failed"
	StackPhaseDegraded    StackPhase = "Degraded"
	StackPhaseProgressing StackPhase = "Progressing"
)

type StackPreviewConfig

type StackPreviewConfig struct {
	ID                string `gorm:"primary_key;default:gen_random_uuid()"`
	OrganisationID    string `gorm:"not null"`
	ProjectID         string `gorm:"not null"`
	UserID            string `gorm:"not null"`
	Name              string `gorm:"not null"`
	Description       string
	GitRepository     PreviewGitRepository `gorm:"type:jsonb;not null"`
	StackfilePath     string               `gorm:"not null;default:'stackfile.yaml'"`
	MaxActivePreviews int                  `gorm:"not null;default:10"`
	Env               EnvVars              `gorm:"type:jsonb" json:"env"`
	RepoURLNormalized string               `gorm:"column:repo_url_normalized" json:"-"`
	Labels            Labels               `gorm:"type:jsonb"`
	Annotations       Annotations          `gorm:"type:jsonb"`
	CreatedAt         time.Time
	UpdatedAt         time.Time
}

StackPreviewConfig defines how preview environments are created for a stack.

func (*StackPreviewConfig) GitBaseBranch

func (s *StackPreviewConfig) GitBaseBranch() string

func (*StackPreviewConfig) GitRepoURL

func (s *StackPreviewConfig) GitRepoURL() string

func (*StackPreviewConfig) NormalizedRepoURL

func (s *StackPreviewConfig) NormalizedRepoURL() string

NormalizedRepoURL returns the config's repo URL in normalized form, for comparison and for persisting into RepoURLNormalized.

func (StackPreviewConfig) TableName

func (StackPreviewConfig) TableName() string

type StackRelease

type StackRelease struct {
	ID               string            `gorm:"primary_key;default:gen_random_uuid()"`
	StackID          string            `gorm:"not null"`
	Sequence         int               `gorm:"not null"`
	State            StackReleaseState `gorm:"not null"`
	Message          string
	Cause            ReleaseCause     `gorm:"type:jsonb"`
	Snapshot         StackSnapshot    `gorm:"type:jsonb;not null"`
	SnapshotRevision string           `gorm:"not null"`
	Manifest         *ReleaseManifest `gorm:"type:jsonb"`
	ManifestRevision string
	Pins             ReleasePins `gorm:"type:jsonb"`
	RendererVersion  string
	Outcome          *ReleaseOutcome         `gorm:"type:jsonb"`
	ValidationErrors ReleaseValidationErrors `gorm:"type:jsonb"`
	WorkerStatus     *ReleaseWorkerStatus    `gorm:"type:jsonb"`
	CreatedBy        string
	CreatedAt        time.Time
	UpdatedAt        time.Time
	RenderedAt       *time.Time
	CompletedAt      *time.Time
}

StackRelease represents a single atomic deployment attempt for a stack.

func (*StackRelease) ConvergeClockStartedAt

func (r *StackRelease) ConvergeClockStartedAt() *time.Time

ConvergeClockStartedAt returns the stamped clock start, or nil when the worker status block is absent entirely.

func (StackRelease) TableName

func (StackRelease) TableName() string

type StackReleaseOperand

type StackReleaseOperand struct{ ID string }

type StackReleaseRefs

type StackReleaseRefs struct {
	Converged *StackRelease
	Latest    *StackRelease
}

StackReleaseRefs pairs the currently converged (live) release with the highest-sequence one for stack embedding.

type StackReleaseState

type StackReleaseState string

StackReleaseState tracks the lifecycle of a release.

const (
	ReleaseStatePending    StackReleaseState = "Pending"
	ReleaseStateInProgress StackReleaseState = "InProgress"
	ReleaseStateReleased   StackReleaseState = "Released"
	ReleaseStateFailed     StackReleaseState = "Failed"
	ReleaseStateSuperseded StackReleaseState = "Superseded"
	ReleaseStateCancelled  StackReleaseState = "Cancelled"
)

func TerminalStackReleaseStates

func TerminalStackReleaseStates() []StackReleaseState

func (StackReleaseState) Active

func (s StackReleaseState) Active() bool

Active returns true if the release is still in-flight (not terminal).

func (StackReleaseState) Terminal

func (s StackReleaseState) Terminal() bool

Terminal returns true if the release has reached a final state.

type StackResource

type StackResource struct {
	ID          string `gorm:"default:gen_random_uuid()"`
	UserID      string `gorm:"not null"`
	StackID     string
	Name        string      `gorm:"<-:create"`
	Namespace   string      `gorm:"<-:create"`
	Labels      Labels      `gorm:"type:jsonb"`
	Annotations Annotations `gorm:"type:jsonb"`
	// Tracks the version of the object in the database.
	Version         int
	BuildConfig     *BuildConfigSpec   `gorm:"type:jsonb"`
	ImageConfig     *ImageConfigSpec   `gorm:"type:jsonb"`
	Init            *InitConfig        `gorm:"type:jsonb"`
	ExecutionConfig *ExecutionConfig   `gorm:"type:jsonb"`
	VolumeMounts    []*VolumeMount     `gorm:"-"`
	DependsOn       Dependencies       `gorm:"type:jsonb"`
	LifecycleConfig *LifecycleConfig   `gorm:"type:jsonb"`
	Ports           Ports              `gorm:"type:jsonb"`
	Outputs         []OutputDescriptor `gorm:"-" json:"outputs,omitempty"`
	WorkloadType    WorkloadType
	Schedule        string
	Replicas        *int32
	Status          *StackResourceStatus `gorm:"type:jsonb"`
	CreatedAt       time.Time
	UpdatedAt       time.Time
}

func (*StackResource) EnsureDeclaredOutputs

func (r *StackResource) EnsureDeclaredOutputs() []OutputDescriptor

func (*StackResource) GitIntegrationID

func (s *StackResource) GitIntegrationID() string

GitIntegrationID returns the pinned org-level git integration for clone auth, or "" if none is set.

func (*StackResource) HasGitCredentials

func (s *StackResource) HasGitCredentials() bool

func (*StackResource) HasImagePullSecrets

func (s *StackResource) HasImagePullSecrets() bool

func (*StackResource) HasImagePushSecrets

func (s *StackResource) HasImagePushSecrets() bool

HasImagePushSecrets checks if any stack resource has an image push secret configured.

func (*StackResource) InternalServiceHost

func (r *StackResource) InternalServiceHost() string

func (*StackResource) RegistryPullCredentialID

func (s *StackResource) RegistryPullCredentialID() string

RegistryPullCredentialID returns the pinned org-level registry credential for image pulls, or "" if none is set.

func (*StackResource) RegistryPushCredentialID

func (s *StackResource) RegistryPushCredentialID() string

RegistryPushCredentialID returns the pinned org-level registry credential for the push target, or "" if none is set.

func (*StackResource) ToOutputMap

func (r *StackResource) ToOutputMap() map[string]string

func (*StackResource) VolumeMountMap

func (v *StackResource) VolumeMountMap() map[string]*VolumeMount

type StackResourceConditionType

type StackResourceConditionType string
const (
	StackResourceConditionAvailable   StackResourceConditionType = "Available"
	StackResourceConditionProgressing StackResourceConditionType = "Progressing"
	StackResourceConditionConverged   StackResourceConditionType = "StackResourceConverged"
	StackResourceConditionBuildReady  StackResourceConditionType = "BuildReady"
)

type StackResourceConvergenceRecord

type StackResourceConvergenceRecord struct {
	Revision string    `json:"revision"`
	At       time.Time `json:"at"`
}

type StackResourceFailure

type StackResourceFailure struct {
	Type          StackResourceFailureType `json:"type"`
	Container     *ContainerFailureDetail  `json:"container,omitempty"`
	InitContainer *ContainerFailureDetail  `json:"init_container,omitempty"`
	Build         *BuildFailureDetail      `json:"build,omitempty"`
}

type StackResourceFailureType

type StackResourceFailureType string
const (
	FailureTypeRuntimeCrash     StackResourceFailureType = "runtime_crash"
	FailureTypeBuildFailure     StackResourceFailureType = "build_failure"
	FailureTypeReadinessFailure StackResourceFailureType = "readiness_failure"
)

type StackResourcePhase

type StackResourcePhase string

type StackResourceState

type StackResourceState string
const (
	StackResourcePhasePending StackResourceState = "Pending"
	StackResourcePhaseReady   StackResourceState = "Ready"
	StackResourcePhaseFailed  StackResourceState = "Failed"
	StackResourcePhaseUnknown StackResourceState = "Error"
)

type StackResourceStatus

type StackResourceStatus struct {
	State                         StackResourceState    `json:"state"`
	Message                       string                `json:"message"`
	ObservedCrRevision            string                `json:"observed_cr_revision"`
	Conditions                    []Condition           `json:"conditions"`
	PublicIngresses               []Ingress             `json:"public_ingresses"`
	InternalServiceName           *string               `json:"internal_service_name,omitempty"`
	LastObservedStatusHash        string                `json:"last_observed_status_hash,omitempty"`
	LastRestartRequestProcessedAt *time.Time            `json:"last_restart_request_processed_at,omitempty"`
	LastFailure                   *StackResourceFailure `json:"last_failure,omitempty"`
	Replicas                      int32                 `json:"replicas,omitempty"`
	AvailableReplicas             int32                 `json:"available_replicas,omitempty"`
	UpdatedReplicas               int32                 `json:"updated_replicas,omitempty"`
	LastRunTime                   *time.Time            `json:"last_run_time,omitempty"`
	LastRunSucceeded              *bool                 `json:"last_run_succeeded,omitempty"`
}

func (*StackResourceStatus) Scan

func (rs *StackResourceStatus) Scan(value interface{}) error

func (StackResourceStatus) Value

func (rs StackResourceStatus) Value() (driver.Value, error)

type StackResourceSummary

type StackResourceSummary struct {
	Name              string                          `json:"name"`
	Phase             StackResourcePhase              `json:"phase,omitempty"`
	ObservedRevision  string                          `json:"observed_revision,omitempty"`
	ConvergedRevision string                          `json:"converged_revision,omitempty"`
	LastConverged     *StackResourceConvergenceRecord `json:"last_converged,omitempty"`
	AvailableReplicas int32                           `json:"available_replicas,omitempty"`
	UpdatedReplicas   int32                           `json:"updated_replicas,omitempty"`
	Replicas          int32                           `json:"replicas,omitempty"`
	Missing           bool                            `json:"missing,omitempty"`
	Message           string                          `json:"message,omitempty"`
}

type StackSettings

type StackSettings struct {
	ReleaseRetentionLimit int `json:"release_retention_limit"`
	MinSuccessfulReleases int `json:"min_successful_releases"`
}

func (*StackSettings) Scan

func (s *StackSettings) Scan(value interface{}) error

func (StackSettings) Value

func (s StackSettings) Value() (driver.Value, error)

type StackShellSnapshot

type StackShellSnapshot struct {
	ID             string      `json:"id"`
	OrganisationID string      `json:"organisation_id"`
	ProjectID      string      `json:"project_id"`
	ClusterID      string      `json:"cluster_id"`
	UserID         string      `json:"user_id"`
	Name           string      `json:"name"`
	NamespaceID    string      `json:"namespace_id"`
	Namespace      string      `json:"namespace"`
	Labels         Labels      `json:"labels"`
	Annotations    Annotations `json:"annotations"`
}

StackShellSnapshot captures the identifying fields of a Stack at a point in time.

type StackSnapshot

type StackSnapshot struct {
	Stack       StackShellSnapshot `json:"stack"`
	Resources   []*StackResource   `json:"resources"`
	Volumes     []*Volume          `json:"volumes"`
	Connections StackConnections   `json:"connections"`
	CapturedAt  time.Time          `json:"captured_at"`
}

StackSnapshot is an immutable copy of a stack's full spec at the time a release was created.

func NewStackSnapshot

func NewStackSnapshot(stack *Stack) (StackSnapshot, error)

NewStackSnapshot deep-copies a Stack into a snapshot. Uses JSON round-trip to break pointer sharing so downstream mutations don't corrupt live objects.

func (*StackSnapshot) Scan

func (s *StackSnapshot) Scan(value interface{}) error

func (*StackSnapshot) ToStack

func (s *StackSnapshot) ToStack() *Stack

ToStack reconstructs a Stack from the snapshot for rendering.

func (StackSnapshot) Value

func (s StackSnapshot) Value() (driver.Value, error)

type StackState

type StackState string
const (
	StackReady       StackState = "Ready"
	StackDeleting    StackState = "Deleting"
	StackPending     StackState = "Pending"
	StackFailed      StackState = "Failed"
	StackError       StackState = "Error"
	StackDegraded    StackState = "Degraded"
	StackProgressing StackState = "Progressing"
)

type StackStatus

type StackStatus struct {
	State                  StackState              `json:"state"`
	Message                string                  `json:"message"`
	ObservedCrRevision     string                  `json:"observed_cr_revision"`
	Conditions             []Condition             `json:"conditions"`
	LastObservedStatusHash string                  `json:"last_observed_status_hash"`
	LastValidationRun      *ValidationRun          `json:"last_validation_run"`
	TargetRevision         string                  `json:"target_revision,omitempty"`
	LastConverged          *StackConvergenceRecord `json:"last_converged,omitempty"`
	Resources              []StackResourceSummary  `json:"resources,omitempty"`
}

func (*StackStatus) GetLastConverged

func (s *StackStatus) GetLastConverged() *StackConvergenceRecord

func (*StackStatus) Scan

func (ws *StackStatus) Scan(value interface{}) error

func (StackStatus) Value

func (ws StackStatus) Value() (driver.Value, error)

type StackStorage

type StackStorage struct {
	ID             string `gorm:"primary_key;default:gen_random_uuid()" json:"id"`
	OrganisationID string `gorm:"not null"`
	UserID         string `gorm:"not null"`
	Name           string `gorm:"not null; <-:create"`
	Namespace      string `gorm:"unique;not null;  <-:create"`
	WorkspaceName  string `gorm:"<-:create"`
	// Tracks the version of the object in the database.
	Version           int
	Labels            Labels              `gorm:"type:jsonb"`
	Annotations       Annotations         `gorm:"type:jsonb"`
	SSHConfig         SSHConfig           `gorm:"type:jsonb"`
	Volumes           []*Volume           `gorm:"foreignKey:StorageID"`
	Status            *StackStorageStatus `gorm:"type:jsonb"`
	DeletionTimeStamp *time.Time          `json:"deletion_timestamp"`
	CreatedAt         time.Time
	UpdatedAt         time.Time
}

func (*StackStorage) SetState

func (w *StackStorage) SetState(state StackStorageState) bool

func (*StackStorage) VolumeExists

func (w *StackStorage) VolumeExists(volumeID string) bool

func (*StackStorage) VolumeMap

func (w *StackStorage) VolumeMap() map[string]*Volume

type StackStorageState

type StackStorageState string
const (
	StackStorageStateCreating StackStorageState = "Creating"
	StackStorageStateReady    StackStorageState = "Ready"
	StackStorageStateDeleting StackStorageState = "Deleting"
	StackStorageStateFailed   StackStorageState = "Failed"
	StackStorageStateCreated  StackStorageState = "Created"
	StackStorageStatePending  StackStorageState = "Pending"
)

type StackStorageStatus

type StackStorageStatus struct {
	State                    StackStorageState `json:"state"`
	Conditions               []Condition       `json:"conditions"`
	Phase                    string            `json:"phase"`
	StorageServerServiceName string            `json:"storage_server_service_name"`
	LastObservedStatusHash   string            `json:"last_observed_status_hash,omitempty"`
	ObservedVersion          int64             `json:"observed_version"`
	// Subpath within the storage pod where different volumes are mounted.
	VolumeMountPaths []VolumeMountPath `json:"volume_mount_paths,omitempty"`
}

func (*StackStorageStatus) Scan

func (s *StackStorageStatus) Scan(value interface{}) error

func (StackStorageStatus) Value

func (s StackStorageStatus) Value() (driver.Value, error)

type StackTopology

type StackTopology struct {
	Nodes []TopologyNode `json:"nodes"`
	Edges []TopologyEdge `json:"edges"`
}

type StackVolume

type StackVolume struct {
	StackID  string `gorm:"primary_key"`
	VolumeID string `gorm:"primary_key"`
}

type StringSlice

type StringSlice []string

func (*StringSlice) Scan

func (s *StringSlice) Scan(src any) error

func (StringSlice) Value

func (s StringSlice) Value() (driver.Value, error)

type TopologyEdge

type TopologyEdge struct {
	Id       string                 `json:"id,omitempty"`
	Kind     string                 `json:"kind"`
	Source   TopologyNodeRef        `json:"source"`
	Target   TopologyNodeRef        `json:"target"`
	Mappings []ConnectionMapping    `json:"mappings,omitempty"`
	Config   map[string]interface{} `json:"config,omitempty"`
	// If its from user's explicit connection or inferred by the system, Like consuming pull secrets, git credentials.
	SourceOfTruth string `json:"source_of_truth"`
}

type TopologyNode

type TopologyNode struct {
	Ref     TopologyNodeRef    `json:"ref"`
	Label   string             `json:"label"`
	Outputs []OutputDescriptor `json:"outputs,omitempty"`
	State   string             `json:"state,omitempty"`
}

type TopologyNodeRef

type TopologyNodeRef struct {
	Type TopologyNodeType `json:"type"`
	Id   string           `json:"id,omitempty"`
	Name string           `json:"name,omitempty"`
}

func (*TopologyNodeRef) Scan

func (r *TopologyNodeRef) Scan(value interface{}) error

func (TopologyNodeRef) Value

func (r TopologyNodeRef) Value() (driver.Value, error)

type TopologyNodeType

type TopologyNodeType string
const (
	TopologyNodeTypeStackResource TopologyNodeType = "stack_resource"
	TopologyNodeTypePostgresAddon TopologyNodeType = "addon/postgres"
	TopologyNodeTypeSecret        TopologyNodeType = "secret"
	TopologyNodeTypeVolume        TopologyNodeType = "volume"
	TopologyNodeTypeObjectStore   TopologyNodeType = "object_store"
)

type User

type User struct {
	ID             string `gorm:"primary_key;default:gen_random_uuid()" json:"id"`
	CreatedAt      time.Time
	UpdatedAt      time.Time
	Name           string
	Email          string `gorm:"unique"`
	Password       string
	Organisation   *Organisation `gorm:"foreignKey:OrganisationID"`
	Role           UserRole
	OrganisationID string
	GithubID       *string `gorm:"column:github_id;uniqueIndex"`
	AvatarURL      *string `gorm:"column:avatar_url"`
}

func (*User) ClusterAccessRules

func (u *User) ClusterAccessRules() []rbacv1.PolicyRule

func (*User) IsOrgAdmin

func (u *User) IsOrgAdmin() bool

type UserRole

type UserRole string

UserRole represents org-level roles stored on the User model. OrgAdmin = full org access. Empty string = permissions derived from project memberships. OrgMemberRole is not stored on User.Role; it is a Casbin-only grouping auto-managed by project membership lifecycle.

const (
	NoRole        UserRole = ""
	OrgAdminRole  UserRole = "OrgAdmin"
	OrgMemberRole UserRole = "OrgMember"
)

func (UserRole) String

func (r UserRole) String() string

type ValidationRun

type ValidationRun struct {
	// List of validation types that were run.
	ValidationTypes []string `json:"validation_types"`
	StackRevision   string   `json:"stack_revision"`
	Passed          bool     `json:"passed"`
	Message         string   `json:"message"`
}

type ValueRef

type ValueRef struct {
	Output   string                    `json:"output,omitempty"`
	Template string                    `json:"template,omitempty"`
	Values   map[string]OutputValueRef `json:"values,omitempty"`
}

type Volume

type Volume struct {
	ID             string           `gorm:"primary_key;default:gen_random_uuid()" json:"id"`
	OrganisationID string           `gorm:"not null" json:"organisation_id"`
	ProjectID      string           `gorm:"index" json:"project_id"`
	UserID         string           `gorm:"not null" json:"user_id"`
	Name           string           `gorm:"not null; <-:create" json:"name"`
	NamespaceID    string           `gorm:"not null" json:"namespace_id"`
	Namespace      string           `gorm:"not null;  <-:create" json:"namespace"`
	Labels         Labels           `gorm:"type:jsonb" json:"labels"`
	Annotations    Annotations      `gorm:"type:jsonb" json:"annotations"`
	Size           string           `gorm:"<-:create" json:"size"`
	StorageClass   string           `gorm:"<-:create" json:"storage_class,omitempty"`
	AccessMode     VolumeAccessMode `gorm:"not null; <-:create"`
	VolumeSource   *VolumeSource    `gorm:"type:jsonb" json:"volume_source,omitempty"`
	SyncBeforeUse  bool             `json:"sync_before_use"`
	Status         *VolumeStatus    `gorm:"type:jsonb" json:"volume_status,omitempty"`
	CreatedAt      time.Time        `json:"created_at"`
	UpdatedAt      time.Time        `json:"updated_at"`
}

func (*Volume) VolumeSourceType

func (v *Volume) VolumeSourceType() SourceVolumeType

type VolumeAccessMode

type VolumeAccessMode string
const (
	READ_WRITE_ONCE VolumeAccessMode = "ReadWriteOnce"
	READ_WRITE_MANY VolumeAccessMode = "ReadWriteMany"
	READ_ONLY_MANY  VolumeAccessMode = "ReadOnlyMany"
)

type VolumeBuildSource

type VolumeBuildSource struct {
	SourceVolumeID   string `json:"source_volume_id"`
	SourceVolumeName string `json:"source_volume_name"`
}

type VolumeMount

type VolumeMount struct {
	StackID          string
	StackResourceID  string
	SourceVolumeName string
	SourceVolumeID   string
	SourceVolumeType SourceVolumeType
	SourceSubPath    string
	TargetPath       string
}

type VolumeMountPath

type VolumeMountPath struct {
	VolumeID string `json:"volume_id"`
	Path     string `json:"path"`
}

func (*VolumeMountPath) Scan

func (vmp *VolumeMountPath) Scan(value interface{}) error

Scan and Value methods for VolumeMountPath

func (VolumeMountPath) Value

func (vmp VolumeMountPath) Value() (driver.Value, error)

type VolumeOperand

type VolumeOperand struct{ ID string }

type VolumeRevision

type VolumeRevision struct {
	// Hash of the contents of the volume.
	CurrentVolumeHash string `json:"current_volume_hash"`
}

type VolumeSource

type VolumeSource struct {
	RemoteDirSource *RemoteDirSource     `json:"remote_dir_source,omitempty"`
	BuildSource     BuildArtifactSources `json:"build_source,omitempty"`
	GitRepoSource   *GitRepoSource       `json:"git_repo_source,omitempty"`
}

func (*VolumeSource) Scan

func (v *VolumeSource) Scan(value interface{}) error

func (VolumeSource) Value

func (v VolumeSource) Value() (driver.Value, error)

type VolumeStatus

type VolumeStatus struct {
	ObservedGeneration     int64                   `json:"observed_generation"`
	Conditions             []Condition             `json:"conditions"`
	Phase                  string                  `json:"phase"`
	BuildArtifactSyncs     []BuildArtifactSyncInfo `json:"build_artifact_syncs,omitempty"`
	LastObservedStatusHash string                  `json:"last_observed_status_hash,omitempty"`
	InUse                  bool                    `json:"in_use"`
	LastSyncedGitRevision  string                  `json:"last_synced_git_revision,omitempty"`
	LastRemoteDirSyncHash  string                  `json:"last_remote_dir_sync_hash,omitempty"`
}

func (*VolumeStatus) Scan

func (v *VolumeStatus) Scan(value interface{}) error

func (VolumeStatus) Value

func (v VolumeStatus) Value() (driver.Value, error)

type WorkloadType

type WorkloadType string
const (
	WorkloadTypeService         WorkloadType = "Service"
	WorkloadTypeStatefulService WorkloadType = "StatefulService"
	WorkloadTypeWorker          WorkloadType = "Worker"
	WorkloadTypeJob             WorkloadType = "Job"
	WorkloadTypeCronJob         WorkloadType = "CronJob"
)

Jump to

Keyboard shortcuts

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