Documentation
¶
Index ¶
- Constants
- type ContainerState
- type DB
- func (d *DB) CheckLocalRegistryCollision(reg *models.Registry) error
- func (d *DB) ClearAllControllerVolumeMounts() error
- func (d *DB) ClearControllerMicroserviceRuntimeFields() error
- func (d *DB) ClearControllerMicroservices() error
- func (d *DB) ClearControllerModels() error
- func (d *DB) ClearControllerRegistries() error
- func (d *DB) ClearControllerRuntimeClasses() error
- func (d *DB) ClearLocalRuntimeClasses() error
- func (d *DB) ClearLocalWorkloadRuntimeFields() error
- func (d *DB) ClearLocalWorkloads() error
- func (d *DB) ClearRuntimeContainerRefs(scope string) error
- func (d *DB) ClearServiceAccountTokens() error
- func (d *DB) Close() error
- func (d *DB) Conn() *sql.DB
- func (d *DB) CountModelRefs(name string) (int, error)
- func (d *DB) DeleteAgentPrivateKey() error
- func (d *DB) DeleteControllerVolumeMount(uuid string) error
- func (d *DB) DeleteEdgeGuardSignature() error
- func (d *DB) DeleteLocalModel(name string) error
- func (d *DB) DeleteLocalRegistry(id int) error
- func (d *DB) DeleteLocalRuntimeClass(name string) error
- func (d *DB) DeleteLocalWorkload(id string) error
- func (d *DB) DeleteModelRefs(name string) error
- func (d *DB) DeleteRuntimeContainerRef(msUUID, scope string) error
- func (d *DB) DeleteSystemControlPlane() error
- func (d *DB) DeleteWorkloadModelRefs(msUUID string) error
- func (d *DB) EnsureDefaultControllerRegistries() error
- func (d *DB) EnsureDefaultLocalRegistries() error
- func (d *DB) FindLocalWorkloadsByAppAndName(application, name string) ([]*models.LocalDeployedMicroservice, error)
- func (d *DB) GetAgentPrivateKey() (privateKeyB64 string, found bool, err error)
- func (d *DB) GetControllerModelByName(name string) (*models.ControllerModel, error)
- func (d *DB) GetControllerRegistry(id int) (*models.Registry, error)
- func (d *DB) GetControllerRuntimeClass(name string) (*models.ControllerRuntimeClass, error)
- func (d *DB) GetControllerVolumeMountByUUID(uuid string) (*VolumeMountRecord, error)
- func (d *DB) GetEdgeGuardSignature() (signature string, found bool, err error)
- func (d *DB) GetLocalModel(name string) (*models.LocalModel, error)
- func (d *DB) GetLocalRegistry(id int) (*models.Registry, error)
- func (d *DB) GetLocalRuntimeClass(name string) (*models.LocalRuntimeClass, error)
- func (d *DB) GetLocalWorkload(id string) (*models.LocalDeployedMicroservice, error)
- func (d *DB) GetRuntimeContainerRef(msUUID, scope string) (*ContainerState, error)
- func (d *DB) GetSystemControlPlane() (*models.ControlPlaneDeployment, bool, error)
- func (d *DB) IsManagedFleetRuntimeClass(name string, provisioned bool) (bool, error)
- func (d *DB) ListActiveServiceAccountTokens() ([]*models.ServiceAccountToken, error)
- func (d *DB) ListLocalModels() ([]*models.LocalModel, error)
- func (d *DB) ListLocalRuntimeClasses() ([]*models.LocalRuntimeClass, error)
- func (d *DB) ListLocalWorkloads() ([]*models.LocalDeployedMicroservice, error)
- func (d *DB) ListPruneKeepModelNames(includeWorkloadRefs bool) ([]string, error)
- func (d *DB) ListReferencedModelNames() ([]string, error)
- func (d *DB) ListServiceAccountTokens() ([]*models.ServiceAccountToken, error)
- func (d *DB) LoadAllControllerVolumeMounts() ([]VolumeMountRecord, error)
- func (d *DB) LoadControllerMicroservices() ([]*models.Microservice, error)
- func (d *DB) LoadControllerModels() ([]*models.ControllerModel, error)
- func (d *DB) LoadControllerRegistries() ([]*models.Registry, error)
- func (d *DB) LoadControllerRuntimeClasses() ([]*models.ControllerRuntimeClass, error)
- func (d *DB) LoadLocalRegistries() ([]*models.Registry, error)
- func (d *DB) LookupRegistry(id int) (*models.Registry, error)
- func (d *DB) NextLocalRegistryID() (int, error)
- func (d *DB) Open(dir string) error
- func (d *DB) ReplaceAllControllerVolumeMounts(records []VolumeMountRecord) error
- func (d *DB) ReplaceWorkloadModelRefs(msUUID string, names []string) error
- func (d *DB) RevokeAllServiceAccountTokens(revokedAtSec int64) error
- func (d *DB) RevokeServiceAccountToken(jti string, revokedAtSec int64) error
- func (d *DB) SaveControllerMicroservices(microservices []*models.Microservice) error
- func (d *DB) SaveControllerModels(items []*models.ControllerModel) error
- func (d *DB) SaveControllerRegistries(registries []*models.Registry) error
- func (d *DB) SaveControllerRuntimeClasses(items []*models.ControllerRuntimeClass) error
- func (d *DB) UpsertAgentPrivateKey(privateKeyB64 string) error
- func (d *DB) UpsertControllerRegistry(reg *models.Registry) error
- func (d *DB) UpsertControllerVolumeMount(rec VolumeMountRecord) error
- func (d *DB) UpsertEdgeGuardSignature(jwt string) error
- func (d *DB) UpsertLocalModel(m *models.LocalModel) error
- func (d *DB) UpsertLocalRegistry(reg *models.Registry) error
- func (d *DB) UpsertLocalRuntimeClass(rc *models.LocalRuntimeClass) error
- func (d *DB) UpsertLocalWorkload(ms *models.LocalDeployedMicroservice) error
- func (d *DB) UpsertRuntimeContainerRef(msUUID, scope, workloadID, sandboxID string) error
- func (d *DB) UpsertServiceAccountToken(token *models.ServiceAccountToken) error
- func (d *DB) UpsertSystemControlPlane(dep *models.ControlPlaneDeployment) error
- type VolumeMountRecord
Constants ¶
const ( RuntimeScopeController = "controller" RuntimeScopeLocal = "local" )
Runtime container ref scopes stored in runtime_container_refs.scope.
const ModelRefKindWorkload = "workload"
ModelRefKindWorkload is the model_refs.kind value for a microservice catalog bind.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContainerState ¶
ContainerState holds workload and sandbox container IDs for a microservice at a scope.
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB wraps the SQLite database connection
func (*DB) CheckLocalRegistryCollision ¶ added in v1.1.0
CheckLocalRegistryCollision returns a validate error when id exists with a different (type, url).
func (*DB) ClearAllControllerVolumeMounts ¶
ClearAllControllerVolumeMounts removes all controller volume mount rows (used on deprovision).
func (*DB) ClearControllerMicroserviceRuntimeFields ¶
ClearControllerMicroserviceRuntimeFields clears ephemeral runtime columns while keeping spec rows.
func (*DB) ClearControllerMicroservices ¶
ClearControllerMicroservices removes all controller microservice rows (used on deprovision).
func (*DB) ClearControllerModels ¶ added in v1.1.0
ClearControllerModels removes all controller model rows.
func (*DB) ClearControllerRegistries ¶
ClearControllerRegistries removes all controller registry rows (used on deprovision).
func (*DB) ClearControllerRuntimeClasses ¶ added in v1.1.0
ClearControllerRuntimeClasses removes all fleet RuntimeClass rows.
func (*DB) ClearLocalRuntimeClasses ¶
ClearLocalRuntimeClasses removes all RuntimeClass rows.
func (*DB) ClearLocalWorkloadRuntimeFields ¶
ClearLocalWorkloadRuntimeFields clears runtime tracking on local workload rows.
func (*DB) ClearLocalWorkloads ¶
ClearLocalWorkloads removes all local workload records.
func (*DB) ClearRuntimeContainerRefs ¶
ClearRuntimeContainerRefs removes runtime container ref rows. When scope is non-empty, only rows matching that scope are deleted.
func (*DB) ClearServiceAccountTokens ¶
ClearServiceAccountTokens removes all token metadata rows.
func (*DB) Close ¶
Close checkpoints the WAL (TRUNCATE) then closes the connection. Production path: internal/supervisor.(*Supervisor).Stop() calls store.GetInstance().Close() last.
func (*DB) CountModelRefs ¶ added in v1.1.0
CountModelRefs returns how many explicit refs exist for one model name.
func (*DB) DeleteAgentPrivateKey ¶
DeleteAgentPrivateKey removes the provisioned private key payload.
func (*DB) DeleteControllerVolumeMount ¶
DeleteControllerVolumeMount removes a controller volume mount record by UUID.
func (*DB) DeleteEdgeGuardSignature ¶
DeleteEdgeGuardSignature removes the stored edgeguard signature JWT.
func (*DB) DeleteLocalModel ¶ added in v1.1.0
DeleteLocalModel deletes one local model by metadata.name.
func (*DB) DeleteLocalRegistry ¶
DeleteLocalRegistry deletes a local registry by ID.
func (*DB) DeleteLocalRuntimeClass ¶
DeleteLocalRuntimeClass deletes one RuntimeClass by name.
func (*DB) DeleteLocalWorkload ¶
DeleteLocalWorkload removes a local workload record by id.
func (*DB) DeleteModelRefs ¶ added in v1.1.0
DeleteModelRefs removes explicit references for one model name.
func (*DB) DeleteRuntimeContainerRef ¶
DeleteRuntimeContainerRef removes the runtime container ref for msUUID at scope.
func (*DB) DeleteSystemControlPlane ¶
DeleteSystemControlPlane removes the singleton system control plane row.
func (*DB) DeleteWorkloadModelRefs ¶ added in v1.1.0
DeleteWorkloadModelRefs removes catalog binds for one microservice UUID.
func (*DB) EnsureDefaultControllerRegistries ¶
EnsureDefaultControllerRegistries ensures docker.io and from_cache defaults exist. Hugging Face Hub is a local-only built-in and is not seeded here.
func (*DB) EnsureDefaultLocalRegistries ¶
EnsureDefaultLocalRegistries ensures built-in public registries exist (docker.io, from_cache, and Hugging Face Hub).
func (*DB) FindLocalWorkloadsByAppAndName ¶
func (d *DB) FindLocalWorkloadsByAppAndName(application, name string) ([]*models.LocalDeployedMicroservice, error)
FindLocalWorkloadsByAppAndName finds local workloads by app/name.
func (*DB) GetAgentPrivateKey ¶
GetAgentPrivateKey reads the provisioned private key payload (base64 JWK). Returns found=false when there is no stored key.
func (*DB) GetControllerModelByName ¶ added in v1.1.0
func (d *DB) GetControllerModelByName(name string) (*models.ControllerModel, error)
GetControllerModelByName returns the fleet-desired model row for a unique name.
func (*DB) GetControllerRegistry ¶ added in v1.1.0
GetControllerRegistry gets one controller registry by ID.
func (*DB) GetControllerRuntimeClass ¶ added in v1.1.0
func (d *DB) GetControllerRuntimeClass(name string) (*models.ControllerRuntimeClass, error)
GetControllerRuntimeClass returns the fleet-desired RuntimeClass row for a name.
func (*DB) GetControllerVolumeMountByUUID ¶
func (d *DB) GetControllerVolumeMountByUUID(uuid string) (*VolumeMountRecord, error)
GetControllerVolumeMountByUUID retrieves a single controller volume mount record by UUID.
func (*DB) GetEdgeGuardSignature ¶
GetEdgeGuardSignature reads the current edgeguard hardware signature JWT. Returns found=false when there is no stored signature.
func (*DB) GetLocalModel ¶ added in v1.1.0
func (d *DB) GetLocalModel(name string) (*models.LocalModel, error)
GetLocalModel retrieves one local model by metadata.name.
func (*DB) GetLocalRegistry ¶
GetLocalRegistry gets one local registry by ID.
func (*DB) GetLocalRuntimeClass ¶
func (d *DB) GetLocalRuntimeClass(name string) (*models.LocalRuntimeClass, error)
GetLocalRuntimeClass returns one RuntimeClass by name.
func (*DB) GetLocalWorkload ¶
func (d *DB) GetLocalWorkload(id string) (*models.LocalDeployedMicroservice, error)
GetLocalWorkload retrieves one local workload record by id.
func (*DB) GetRuntimeContainerRef ¶
func (d *DB) GetRuntimeContainerRef(msUUID, scope string) (*ContainerState, error)
GetRuntimeContainerRef returns the runtime container ref for msUUID at scope. Returns nil if not found or DB not opened.
func (*DB) GetSystemControlPlane ¶
func (d *DB) GetSystemControlPlane() (*models.ControlPlaneDeployment, bool, error)
GetSystemControlPlane reads the singleton system control plane row. Returns found=false when no deployment is stored.
func (*DB) IsManagedFleetRuntimeClass ¶ added in v1.1.0
IsManagedFleetRuntimeClass reports whether name is a controller-desired RuntimeClass while the node is provisioned. Unprovisioned nodes never treat a name as fleet-managed.
func (*DB) ListActiveServiceAccountTokens ¶
func (d *DB) ListActiveServiceAccountTokens() ([]*models.ServiceAccountToken, error)
ListActiveServiceAccountTokens lists non-revoked token metadata.
func (*DB) ListLocalModels ¶ added in v1.1.0
func (d *DB) ListLocalModels() ([]*models.LocalModel, error)
ListLocalModels returns all local model rows ordered by name.
func (*DB) ListLocalRuntimeClasses ¶
func (d *DB) ListLocalRuntimeClasses() ([]*models.LocalRuntimeClass, error)
ListLocalRuntimeClasses returns all applied RuntimeClass rows ordered by name.
func (*DB) ListLocalWorkloads ¶
func (d *DB) ListLocalWorkloads() ([]*models.LocalDeployedMicroservice, error)
ListLocalWorkloads returns all local workload records.
func (*DB) ListPruneKeepModelNames ¶ added in v1.1.0
ListPruneKeepModelNames returns names prune must keep on disk and as rows. Fleet-desired controller model names are always kept. Workload binds are included only when includeWorkloadRefs is true (watchdog excludes them).
func (*DB) ListReferencedModelNames ¶ added in v1.1.0
ListReferencedModelNames returns names that must be kept during dangling prune: fleet-desired controller model names plus any explicit model_refs rows. Unbound local model rows are not kept just because they exist.
func (*DB) ListServiceAccountTokens ¶
func (d *DB) ListServiceAccountTokens() ([]*models.ServiceAccountToken, error)
ListServiceAccountTokens lists token metadata.
func (*DB) LoadAllControllerVolumeMounts ¶
func (d *DB) LoadAllControllerVolumeMounts() ([]VolumeMountRecord, error)
LoadAllControllerVolumeMounts retrieves all controller volume mount records.
func (*DB) LoadControllerMicroservices ¶
func (d *DB) LoadControllerMicroservices() ([]*models.Microservice, error)
LoadControllerMicroservices retrieves all controller microservices ordered by uuid.
func (*DB) LoadControllerModels ¶ added in v1.1.0
func (d *DB) LoadControllerModels() ([]*models.ControllerModel, error)
LoadControllerModels retrieves all controller model rows ordered by name.
func (*DB) LoadControllerRegistries ¶
LoadControllerRegistries retrieves all controller registries ordered by id.
func (*DB) LoadControllerRuntimeClasses ¶ added in v1.1.0
func (d *DB) LoadControllerRuntimeClasses() ([]*models.ControllerRuntimeClass, error)
LoadControllerRuntimeClasses retrieves all fleet RuntimeClass rows ordered by name.
func (*DB) LoadLocalRegistries ¶
LoadLocalRegistries retrieves all local registries ordered by id.
func (*DB) LookupRegistry ¶ added in v1.1.0
LookupRegistry returns a local registry row, falling back to a controller registry.
func (*DB) NextLocalRegistryID ¶ added in v1.1.0
NextLocalRegistryID allocates the next local registry id after built-in rows.
func (*DB) Open ¶
Open opens (or creates) the SQLite database at the given directory and runs migrations
func (*DB) ReplaceAllControllerVolumeMounts ¶
func (d *DB) ReplaceAllControllerVolumeMounts(records []VolumeMountRecord) error
ReplaceAllControllerVolumeMounts atomically replaces all controller volume mount rows. Used by the volume mount manager's full-save on every write.
func (*DB) ReplaceWorkloadModelRefs ¶ added in v1.1.0
ReplaceWorkloadModelRefs replaces catalog binds for one microservice UUID.
func (*DB) RevokeAllServiceAccountTokens ¶
RevokeAllServiceAccountTokens marks all tokens revoked.
func (*DB) RevokeServiceAccountToken ¶
RevokeServiceAccountToken revokes a token by JTI.
func (*DB) SaveControllerMicroservices ¶
func (d *DB) SaveControllerMicroservices(microservices []*models.Microservice) error
SaveControllerMicroservices replaces all controller microservice rows in a single transaction.
func (*DB) SaveControllerModels ¶ added in v1.1.0
func (d *DB) SaveControllerModels(items []*models.ControllerModel) error
SaveControllerModels replaces all controller model rows in a single transaction. Identity is uuid (primary key) plus unique name.
func (*DB) SaveControllerRegistries ¶
SaveControllerRegistries replaces all controller registry rows in a single transaction.
func (*DB) SaveControllerRuntimeClasses ¶ added in v1.1.0
func (d *DB) SaveControllerRuntimeClasses(items []*models.ControllerRuntimeClass) error
SaveControllerRuntimeClasses replaces all fleet RuntimeClass rows in a single transaction. Empty list clears the table. Identity is unique name.
func (*DB) UpsertAgentPrivateKey ¶
UpsertAgentPrivateKey stores the provisioned private key payload (base64 JWK).
func (*DB) UpsertControllerRegistry ¶
UpsertControllerRegistry inserts or updates one controller registry row.
func (*DB) UpsertControllerVolumeMount ¶
func (d *DB) UpsertControllerVolumeMount(rec VolumeMountRecord) error
UpsertControllerVolumeMount inserts or replaces a controller volume mount record.
func (*DB) UpsertEdgeGuardSignature ¶
UpsertEdgeGuardSignature stores the current edgeguard hardware signature JWT.
func (*DB) UpsertLocalModel ¶ added in v1.1.0
func (d *DB) UpsertLocalModel(m *models.LocalModel) error
UpsertLocalModel inserts or updates one local model row by metadata.name.
func (*DB) UpsertLocalRegistry ¶
UpsertLocalRegistry inserts or updates one local registry row.
func (*DB) UpsertLocalRuntimeClass ¶
func (d *DB) UpsertLocalRuntimeClass(rc *models.LocalRuntimeClass) error
UpsertLocalRuntimeClass inserts or updates one RuntimeClass row.
func (*DB) UpsertLocalWorkload ¶
func (d *DB) UpsertLocalWorkload(ms *models.LocalDeployedMicroservice) error
UpsertLocalWorkload upserts a local workload record.
func (*DB) UpsertRuntimeContainerRef ¶
UpsertRuntimeContainerRef upserts a runtime container ref row.
func (*DB) UpsertServiceAccountToken ¶
func (d *DB) UpsertServiceAccountToken(token *models.ServiceAccountToken) error
UpsertServiceAccountToken upserts token metadata.
func (*DB) UpsertSystemControlPlane ¶
func (d *DB) UpsertSystemControlPlane(dep *models.ControlPlaneDeployment) error
UpsertSystemControlPlane stores the singleton system control plane row.
type VolumeMountRecord ¶
type VolumeMountRecord struct {
UUID string
Name string
Version float64
Kind string // "SECRET" or "CONFIGMAP"
Checksum string
Microservices []string // stored as JSON TEXT array
Data map[string]any // stored as JSON TEXT (key->base64 pairs)
UpdatedAt int64
}
VolumeMountRecord represents a single volume mount index entry. UUID, Name, Version, Kind, Checksum are real typed columns. Microservices and Data are JSON-serialized TEXT columns.
Source Files
¶
- control_plane_deployments.go
- controller_models.go
- controller_runtime_classes.go
- db.go
- edgeguard_credentials.go
- local_deployed_microservices.go
- local_models.go
- local_registries.go
- local_runtime_classes.go
- microservices.go
- model_refs.go
- registries.go
- runtime_cleanup.go
- runtime_container_refs.go
- schema.go
- service_account_tokens.go
- volumes.go