Documentation
¶
Index ¶
- Constants
- Variables
- func ControlPlaneStatusMap(item *models.ControlPlaneDeployment) map[string]any
- func IsControlPlaneDeleteBlocked(err error) bool
- func IsControlPlaneLifecycleBlocked(err error) bool
- func IsControlPlaneRestartBlocked(err error) bool
- func NormalizeRuntimeClassOperationStage(stage string) string
- type ControlPlaneApplyResult
- type DeployProgressCallback
- type ErrAmbiguousImageSelector
- type ErrAmbiguousMicroserviceSelector
- type ErrControlPlaneDeleteBlocked
- type ErrControlPlaneIdentityImmutable
- type ErrControlPlaneLifecycleBlocked
- type ErrReservedRuntimeClassDelete
- type ErrRuntimeClassInUse
- type ErrRuntimeClassManagedName
- type ErrRuntimeClassOperation
- type Facade
- func (f *Facade) ApplyControlPlaneManifest(manifest, sourceName string, dryRun bool, progress DeployProgressCallback) (*ControlPlaneApplyResult, error)
- func (f *Facade) ApplyControllerRuntimeClasses(items []*models.ControllerRuntimeClass) error
- func (f *Facade) ApplyLocalManifest(manifest, sourceName string, dryRun bool, progress DeployProgressCallback) (string, *models.LocalDeployManifest, error)
- func (f *Facade) ApplyLocalModelManifests(manifest string, dryRun bool) ([]*models.LocalModel, error)
- func (f *Facade) ApplyLocalRegistryManifest(manifest string, dryRun bool) (*models.Registry, error)
- func (f *Facade) ApplyLocalRuntimeClassManifest(manifest string, dryRun bool) (*models.LocalRuntimeClass, error)
- func (f *Facade) DeleteControlPlane() error
- func (f *Facade) DeleteLocalDeployment(id string) error
- func (f *Facade) DeleteRegistry(id int) error
- func (f *Facade) DeleteRuntimeClass(name string) error
- func (f *Facade) Deprovision(scope string, purgeVolumes bool) error
- func (f *Facade) GetControlPlaneDeployment() (*models.ControlPlaneDeployment, error)
- func (f *Facade) GetControlPlaneManifestMasked() (string, error)
- func (f *Facade) GetLocalDeployment(id string) (*models.LocalDeployedMicroservice, error)
- func (f *Facade) GetModel(name string) (map[string]any, error)
- func (f *Facade) GetModelPull(operationID string) (*modelmanager.PullOperation, bool)
- func (f *Facade) GetRegistry(id int) (*models.Registry, error)
- func (f *Facade) GetRuntimeClass(name string) (*models.LocalRuntimeClass, error)
- func (f *Facade) GetRuntimeMicroservice(id string) (map[string]any, error)
- func (f *Facade) GetRuntimeMicroserviceLogs(selector string, tailLines int, since, until string) (string, []map[string]any, error)
- func (f *Facade) GetSharedVolumeClaim(name string) (map[string]any, error)
- func (f *Facade) KillRuntimeMicroservice(selector string) (string, error)
- func (f *Facade) ListImages() ([]map[string]any, error)
- func (f *Facade) ListLocalDeployments() ([]*models.LocalDeployedMicroservice, error)
- func (f *Facade) ListModels() ([]map[string]any, error)
- func (f *Facade) ListRegistries() ([]*models.Registry, error)
- func (f *Facade) ListRuntimeClasses() ([]*models.LocalRuntimeClass, error)
- func (f *Facade) ListRuntimeMicroservices() []map[string]any
- func (f *Facade) ListVolumeClaims() ([]map[string]any, error)
- func (f *Facade) LoadImageFromPath(path string) ([]engine.LoadedImage, error)
- func (f *Facade) ParseAndValidateControlPlaneManifest(manifest string) (*models.ControlPlaneManifest, error)
- func (f *Facade) ParseAndValidateLocalManifest(manifest string) (*models.LocalDeployManifest, error)
- func (f *Facade) ParseAndValidateLocalModelManifests(manifest string) ([]*models.LocalModelManifest, error)
- func (f *Facade) ParseAndValidateLocalRegistryManifest(manifest string) (*models.LocalRegistryManifest, error)
- func (f *Facade) ParseAndValidateLocalRuntimeClassManifest(manifest string) (*models.LocalRuntimeClassManifest, error)
- func (f *Facade) Provision(provisioningKey string) error
- func (f *Facade) Prune(mode string) (map[string]any, error)
- func (f *Facade) PruneModels(mode string) (*modelmanager.PruneReport, error)
- func (f *Facade) PruneVolumeOrphans(req VolumePruneRequest) (map[string]any, error)
- func (f *Facade) PullImage(imageRef string, registryID *int, platform string) (string, error)
- func (f *Facade) PullImageWithProgress(imageRef string, registryID *int, platform string, onProgress func(float32)) (string, error)
- func (f *Facade) RemoveImage(selector string) (string, error)
- func (f *Facade) RemoveModel(name string) error
- func (f *Facade) RemovePrivateVolume(uuid, name string, force bool) error
- func (f *Facade) RemoveRuntimeMicroservice(selector string) (string, error)
- func (f *Facade) RemoveRuntimeMicroserviceWithCleanup(selector string, cleanup bool) (string, error)
- func (f *Facade) RemoveSharedVolume(name string, force bool) error
- func (f *Facade) ResolveImageDeleteRef(selector string) (string, error)
- func (f *Facade) ResolveMicroserviceID(selector string) (string, error)
- func (f *Facade) RestartControlPlane(pull bool) (*models.ControlPlaneDeployment, error)
- func (f *Facade) RestartRuntimeMicroservice(selector string) (string, error)
- func (f *Facade) SetModelManager(m *modelmanager.Manager)
- func (f *Facade) StartModelPull(name string) (*modelmanager.PullOperation, error)
- func (f *Facade) StartRuntimeMicroservice(selector string) (string, error)
- func (f *Facade) StopRuntimeMicroservice(selector string) (string, error)
- func (f *Facade) UpsertLocalDeployment(ms *models.LocalDeployedMicroservice) error
- func (f *Facade) UpsertLocalModelSpec(name, repo, revision string, registryID int, files []string, format string) (*models.LocalModel, error)
- func (f *Facade) ValidateRuntimeClassDelete(name string) (*models.LocalRuntimeClass, error)
- type VolumePruneRequest
Constants ¶
const ( RuntimeClassStageWriteConfig = "write_config" RuntimeClassStageStopRuntime = "stop_runtime" RuntimeClassStageStartRuntime = "start_runtime" RuntimeClassStageWaitCRIReady = "wait_cri_ready" RuntimeClassStageVerifyStability = "verify_stability" RuntimeClassStageRollbackConfig = "rollback_config" RuntimeClassStageEscalateRestart = "escalate_restart" RuntimeClassStageDone = "done" )
const ( PruneModeDangling = "dangling" PruneModeContainers = "containers" PruneModeVolumes = "volumes" PruneModeAll = "all" )
const ( DeployStageParsing = "parsing" DeployStagePulling = "pulling" DeployStageCreating = "creating" DeployStageStarting = "starting" DeployStagePersisting = "persisting" DeployStageDone = "done" )
Variables ¶
var ( ErrControlPlaneNotFound = errors.New("control plane deployment not found") ErrControlPlaneRestartBlocked = errors.New("control plane restart blocked: apply in progress") )
var ErrRuntimeClassUnsupported = errors.New("runtimeclass is supported only when containerEngine=edgelet")
var ErrSystemPruneVolumes = errors.New("system prune volumes does not destroy persistent VOLUME data; use edgelet volume prune")
ErrSystemPruneVolumes is returned when system prune volumes is asked to destroy persistent VOLUME data. Callers should use volume prune instead.
Functions ¶
func ControlPlaneStatusMap ¶
func ControlPlaneStatusMap(item *models.ControlPlaneDeployment) map[string]any
ControlPlaneStatusMap builds the GET /v1/system/controlplane response body.
func IsControlPlaneDeleteBlocked ¶
IsControlPlaneDeleteBlocked reports whether err blocks control-plane delete while provisioned.
func IsControlPlaneLifecycleBlocked ¶
IsControlPlaneLifecycleBlocked reports whether err blocks control-plane ms lifecycle.
func IsControlPlaneRestartBlocked ¶
IsControlPlaneRestartBlocked reports whether err blocks operator control-plane restart.
Types ¶
type ControlPlaneApplyResult ¶
type ControlPlaneApplyResult struct {
Mode string
ControllerUUID string
Namespace string
Name string
Image string
State string
RuntimeState string
ContainerID string
Generation int64
}
ControlPlaneApplyResult is the control plane apply outcome.
type DeployProgressCallback ¶
DeployProgressCallback reports deploy stage transitions from runtime flow.
type ErrAmbiguousImageSelector ¶ added in v1.0.1
ErrAmbiguousImageSelector indicates an image selector matched multiple images.
func (*ErrAmbiguousImageSelector) Error ¶ added in v1.0.1
func (e *ErrAmbiguousImageSelector) Error() string
type ErrAmbiguousMicroserviceSelector ¶
type ErrAmbiguousMicroserviceSelector struct {
Matches []string
}
ErrAmbiguousMicroserviceSelector indicates selector matched multiple targets.
func (*ErrAmbiguousMicroserviceSelector) Error ¶
func (e *ErrAmbiguousMicroserviceSelector) Error() string
type ErrControlPlaneDeleteBlocked ¶
type ErrControlPlaneDeleteBlocked struct{}
ErrControlPlaneDeleteBlocked indicates DELETE /v1/system/controlplane is forbidden while provisioned.
func (*ErrControlPlaneDeleteBlocked) Error ¶
func (e *ErrControlPlaneDeleteBlocked) Error() string
type ErrControlPlaneIdentityImmutable ¶
type ErrControlPlaneIdentityImmutable struct {
ExistingNamespace string
ExistingName string
NewNamespace string
NewName string
}
ErrControlPlaneIdentityImmutable indicates metadata.name or metadata.namespace changed on patch.
func (*ErrControlPlaneIdentityImmutable) Error ¶
func (e *ErrControlPlaneIdentityImmutable) Error() string
type ErrControlPlaneLifecycleBlocked ¶
type ErrControlPlaneLifecycleBlocked struct {
Operation string
}
ErrControlPlaneLifecycleBlocked indicates ms rm/stop/kill/start/restart on the controller UUID is forbidden.
func (*ErrControlPlaneLifecycleBlocked) Error ¶
func (e *ErrControlPlaneLifecycleBlocked) Error() string
type ErrReservedRuntimeClassDelete ¶
type ErrReservedRuntimeClassDelete struct {
Name string
}
func (*ErrReservedRuntimeClassDelete) Details ¶
func (e *ErrReservedRuntimeClassDelete) Details() map[string]any
func (*ErrReservedRuntimeClassDelete) Error ¶
func (e *ErrReservedRuntimeClassDelete) Error() string
type ErrRuntimeClassInUse ¶
type ErrRuntimeClassInUse struct {
Name string
RuntimeNames []string
BlockingMicroserviceUuids []string
}
func (*ErrRuntimeClassInUse) Details ¶
func (e *ErrRuntimeClassInUse) Details() map[string]any
func (*ErrRuntimeClassInUse) Error ¶
func (e *ErrRuntimeClassInUse) Error() string
type ErrRuntimeClassManagedName ¶ added in v1.1.0
type ErrRuntimeClassManagedName struct {
Name string
}
ErrRuntimeClassManagedName is returned when a local apply targets a name the controller currently manages on this provisioned node.
func (*ErrRuntimeClassManagedName) Details ¶ added in v1.1.0
func (e *ErrRuntimeClassManagedName) Details() map[string]any
func (*ErrRuntimeClassManagedName) Error ¶ added in v1.1.0
func (e *ErrRuntimeClassManagedName) Error() string
type ErrRuntimeClassOperation ¶
func (*ErrRuntimeClassOperation) Details ¶
func (e *ErrRuntimeClassOperation) Details() map[string]any
func (*ErrRuntimeClassOperation) Error ¶
func (e *ErrRuntimeClassOperation) Error() string
func (*ErrRuntimeClassOperation) Unwrap ¶
func (e *ErrRuntimeClassOperation) Unwrap() error
type Facade ¶
type Facade struct {
// contains filtered or unexported fields
}
Facade is a thin runtime adapter used by EdgeletAPI handlers. It intentionally delegates to existing modules to preserve daemon behavior.
func (*Facade) ApplyControlPlaneManifest ¶
func (f *Facade) ApplyControlPlaneManifest(manifest, sourceName string, dryRun bool, progress DeployProgressCallback) (*ControlPlaneApplyResult, error)
ApplyControlPlaneManifest validates, persists, and launches the controller.
func (*Facade) ApplyControllerRuntimeClasses ¶ added in v1.1.0
func (f *Facade) ApplyControllerRuntimeClasses(items []*models.ControllerRuntimeClass) error
ApplyControllerRuntimeClasses replaces the fleet-desired RuntimeClass snapshot and applies it on the edgelet engine. Catalog handlers stay on the existing metadata persist path and do not bounce the data plane.
func (*Facade) ApplyLocalManifest ¶
func (f *Facade) ApplyLocalManifest(manifest, sourceName string, dryRun bool, progress DeployProgressCallback) (string, *models.LocalDeployManifest, error)
ApplyLocalManifest validates and persists local deployment metadata.
func (*Facade) ApplyLocalModelManifests ¶ added in v1.1.0
func (f *Facade) ApplyLocalModelManifests(manifest string, dryRun bool) ([]*models.LocalModel, error)
ApplyLocalModelManifests upserts each Model document by metadata.name. Persist is synchronous. Artifact download is started by the apply handler (or POST /v1/models:pull) after every document is written.
func (*Facade) ApplyLocalRegistryManifest ¶
ApplyLocalRegistryManifest validates and stores a registry manifest. spec.id set → upsert that id; omitted → NextLocalRegistryID(). Built-in ids cannot be edited. Collision on (type, url) for an existing id is a validate error.
func (*Facade) ApplyLocalRuntimeClassManifest ¶
func (f *Facade) ApplyLocalRuntimeClassManifest(manifest string, dryRun bool) (*models.LocalRuntimeClass, error)
ApplyLocalRuntimeClassManifest validates and stores a RuntimeClass manifest.
func (*Facade) DeleteControlPlane ¶
DeleteControlPlane removes the controller deployment, container, and volumes.
func (*Facade) DeleteLocalDeployment ¶
DeleteLocalDeployment removes local deployment by id.
func (*Facade) DeleteRegistry ¶
DeleteRegistry removes one local registry entry.
func (*Facade) DeleteRuntimeClass ¶
DeleteRuntimeClass removes one RuntimeClass entry by name.
func (*Facade) Deprovision ¶
Deprovision deprovisions the agent. purgeVolumes destroys workload persistent VOLUME claims; control-plane volumes are never purged. Shared names stay while any consumer remains.
func (*Facade) GetControlPlaneDeployment ¶
func (f *Facade) GetControlPlaneDeployment() (*models.ControlPlaneDeployment, error)
GetControlPlaneDeployment returns the singleton control plane row.
func (*Facade) GetControlPlaneManifestMasked ¶
GetControlPlaneManifestMasked returns secrets-redacted manifest YAML.
func (*Facade) GetLocalDeployment ¶
func (f *Facade) GetLocalDeployment(id string) (*models.LocalDeployedMicroservice, error)
GetLocalDeployment gets local deployment by id.
func (*Facade) GetModelPull ¶ added in v1.1.0
func (f *Facade) GetModelPull(operationID string) (*modelmanager.PullOperation, bool)
GetModelPull returns one async model pull operation.
func (*Facade) GetRegistry ¶
GetRegistry returns one local registry entry.
func (*Facade) GetRuntimeClass ¶
func (f *Facade) GetRuntimeClass(name string) (*models.LocalRuntimeClass, error)
GetRuntimeClass returns one RuntimeClass entry by name.
func (*Facade) GetRuntimeMicroservice ¶
GetRuntimeMicroservice returns one process-manager tracked microservice.
func (*Facade) GetRuntimeMicroserviceLogs ¶
func (*Facade) GetSharedVolumeClaim ¶ added in v1.1.0
GetSharedVolumeClaim inspects one shared persistent VOLUME claim by name.
func (*Facade) KillRuntimeMicroservice ¶
func (*Facade) ListImages ¶
ListImages returns normalized image list for local runtime engine.
func (*Facade) ListLocalDeployments ¶
func (f *Facade) ListLocalDeployments() ([]*models.LocalDeployedMicroservice, error)
ListLocalDeployments lists local deployment records.
func (*Facade) ListModels ¶ added in v1.1.0
ListModels returns local Model rows as API maps.
func (*Facade) ListRegistries ¶
ListRegistries returns persisted registry entries with defaults guaranteed.
func (*Facade) ListRuntimeClasses ¶
func (f *Facade) ListRuntimeClasses() ([]*models.LocalRuntimeClass, error)
ListRuntimeClasses returns persisted RuntimeClass entries.
func (*Facade) ListRuntimeMicroservices ¶
ListRuntimeMicroservices returns process-manager tracked microservices.
func (*Facade) ListVolumeClaims ¶ added in v1.1.0
ListVolumeClaims returns one row per persistent VOLUME claim. Private claims set uuid; shared claims list every local and controller consumer.
func (*Facade) LoadImageFromPath ¶
func (f *Facade) LoadImageFromPath(path string) ([]engine.LoadedImage, error)
LoadImageFromPath imports a daemon-local image archive path.
func (*Facade) ParseAndValidateControlPlaneManifest ¶
func (f *Facade) ParseAndValidateControlPlaneManifest(manifest string) (*models.ControlPlaneManifest, error)
ParseAndValidateControlPlaneManifest validates ControlPlane YAML.
func (*Facade) ParseAndValidateLocalManifest ¶
func (f *Facade) ParseAndValidateLocalManifest(manifest string) (*models.LocalDeployManifest, error)
ParseAndValidateLocalManifest validates a local deploy manifest.
func (*Facade) ParseAndValidateLocalModelManifests ¶ added in v1.1.0
func (f *Facade) ParseAndValidateLocalModelManifests(manifest string) ([]*models.LocalModelManifest, error)
ParseAndValidateLocalModelManifests decodes one or more Model documents and validates each.
func (*Facade) ParseAndValidateLocalRegistryManifest ¶
func (f *Facade) ParseAndValidateLocalRegistryManifest(manifest string) (*models.LocalRegistryManifest, error)
ParseAndValidateLocalRegistryManifest validates a local registry manifest.
func (*Facade) ParseAndValidateLocalRuntimeClassManifest ¶
func (f *Facade) ParseAndValidateLocalRuntimeClassManifest(manifest string) (*models.LocalRuntimeClassManifest, error)
ParseAndValidateLocalRuntimeClassManifest validates a RuntimeClass manifest.
func (*Facade) PruneModels ¶ added in v1.1.0
func (f *Facade) PruneModels(mode string) (*modelmanager.PruneReport, error)
PruneModels removes unreferenced model artifacts.
func (*Facade) PruneVolumeOrphans ¶ added in v1.1.0
func (f *Facade) PruneVolumeOrphans(req VolumePruneRequest) (map[string]any, error)
PruneVolumeOrphans lists or destroys unreferenced persistent VOLUME claims. Dry-run is the default; Yes is required to destroy.
func (*Facade) PullImage ¶
PullImage pulls an image with optional registry id and platform selector.
func (*Facade) PullImageWithProgress ¶
func (f *Facade) PullImageWithProgress(imageRef string, registryID *int, platform string, onProgress func(float32)) (string, error)
PullImageWithProgress pulls an image while reporting progress updates.
func (*Facade) RemoveImage ¶
RemoveImage removes an image by selector (id, id prefix, name:tag, or digest).
func (*Facade) RemoveModel ¶ added in v1.1.0
RemoveModel deletes one local Model and its on-disk artifacts.
func (*Facade) RemovePrivateVolume ¶ added in v1.1.0
RemovePrivateVolume destroys private persistent VOLUME data under volumes/data/{uuid}.
func (*Facade) RemoveRuntimeMicroservice ¶
func (*Facade) RemoveRuntimeMicroserviceWithCleanup ¶ added in v1.1.0
func (f *Facade) RemoveRuntimeMicroserviceWithCleanup(selector string, cleanup bool) (string, error)
RemoveRuntimeMicroserviceWithCleanup removes a microservice. Persistent VOLUME data is retained. cleanup records a reserved bit for later explicit orphan prune and does not delete files or start a sweeper.
func (*Facade) RemoveSharedVolume ¶ added in v1.1.0
RemoveSharedVolume destroys a shared persistent VOLUME under volumes/shared/{name}.
func (*Facade) ResolveImageDeleteRef ¶ added in v1.0.1
ResolveImageDeleteRef resolves a user selector to an engine delete reference.
func (*Facade) ResolveMicroserviceID ¶
ResolveMicroserviceID resolves selectors in this order: exact UUID -> container ID prefix -> exact ApplicationName.MicroserviceName.
func (*Facade) RestartControlPlane ¶
func (f *Facade) RestartControlPlane(pull bool) (*models.ControlPlaneDeployment, error)
RestartControlPlane bounces the singleton controller container without deprovisioning or deleting the system_control_plane row.
func (*Facade) RestartRuntimeMicroservice ¶
func (*Facade) SetModelManager ¶ added in v1.1.0
func (f *Facade) SetModelManager(m *modelmanager.Manager)
SetModelManager replaces the model manager used by deploy and model routes (tests).
func (*Facade) StartModelPull ¶ added in v1.1.0
func (f *Facade) StartModelPull(name string) (*modelmanager.PullOperation, error)
StartModelPull begins an async artifact pull for a deployed Model. Download is detached from the HTTP request so a 202 return cannot cancel it.
func (*Facade) StartRuntimeMicroservice ¶
func (*Facade) StopRuntimeMicroservice ¶
func (*Facade) UpsertLocalDeployment ¶
func (f *Facade) UpsertLocalDeployment(ms *models.LocalDeployedMicroservice) error
UpsertLocalDeployment upserts one local deployment record.
func (*Facade) UpsertLocalModelSpec ¶ added in v1.1.0
func (f *Facade) UpsertLocalModelSpec(name, repo, revision string, registryID int, files []string, format string) (*models.LocalModel, error)
UpsertLocalModelSpec upserts one Model from pull-request fields using the same validation as deploy apply.
func (*Facade) ValidateRuntimeClassDelete ¶
func (f *Facade) ValidateRuntimeClassDelete(name string) (*models.LocalRuntimeClass, error)
ValidateRuntimeClassDelete validates whether one RuntimeClass can be deleted.