Documentation
¶
Index ¶
- Constants
- Variables
- func ControlPlaneStatusMap(item *models.ControlPlaneDeployment) map[string]any
- func IsControlPlaneLifecycleBlocked(err error) bool
- func NormalizeRuntimeClassOperationStage(stage string) string
- type ControlPlaneApplyResult
- type DeployProgressCallback
- type ErrAmbiguousMicroserviceSelector
- type ErrControlPlaneIdentityImmutable
- type ErrControlPlaneLifecycleBlocked
- type ErrReservedRuntimeClassDelete
- type ErrRuntimeClassInUse
- type ErrRuntimeClassOperation
- type Facade
- func (f *Facade) ApplyControlPlaneManifest(manifest, sourceName string, dryRun bool, progress DeployProgressCallback) (*ControlPlaneApplyResult, error)
- func (f *Facade) ApplyLocalManifest(manifest, sourceName string, dryRun bool, progress DeployProgressCallback) (string, *models.LocalDeployManifest, 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) 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) 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) KillRuntimeMicroservice(selector string) (string, error)
- func (f *Facade) ListImages() ([]map[string]any, error)
- func (f *Facade) ListLocalDeployments() ([]*models.LocalDeployedMicroservice, 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) 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) 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) 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) RemoveRuntimeMicroservice(selector string) (string, error)
- func (f *Facade) ResolveMicroserviceID(selector string) (string, error)
- func (f *Facade) RestartRuntimeMicroservice(selector string) (string, 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) ValidateRuntimeClassDelete(name string) (*models.LocalRuntimeClass, error)
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")
var ErrRuntimeClassUnsupported = errors.New("runtimeclass is supported only when containerEngine=edgelet")
Functions ¶
func ControlPlaneStatusMap ¶
func ControlPlaneStatusMap(item *models.ControlPlaneDeployment) map[string]any
ControlPlaneStatusMap builds the GET /v1/system/controlplane response body.
func IsControlPlaneLifecycleBlocked ¶
IsControlPlaneLifecycleBlocked reports whether err blocks control-plane ms lifecycle.
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 ErrAmbiguousMicroserviceSelector ¶
type ErrAmbiguousMicroserviceSelector struct {
Matches []string
}
ErrAmbiguousMicroserviceSelector indicates selector matched multiple targets.
func (*ErrAmbiguousMicroserviceSelector) Error ¶
func (e *ErrAmbiguousMicroserviceSelector) 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 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) 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) ApplyLocalRegistryManifest ¶
ApplyLocalRegistryManifest validates and stores a registry manifest.
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.
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) 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) 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) 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) 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) 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) 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) RemoveRuntimeMicroservice ¶
func (*Facade) ResolveMicroserviceID ¶
ResolveMicroserviceID resolves selectors in this order: exact UUID -> container ID prefix -> exact ApplicationName.MicroserviceName.
func (*Facade) RestartRuntimeMicroservice ¶
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) ValidateRuntimeClassDelete ¶
func (f *Facade) ValidateRuntimeClassDelete(name string) (*models.LocalRuntimeClass, error)
ValidateRuntimeClassDelete validates whether one RuntimeClass can be deleted.