runtimeapi

package
v1.0.0-beta.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 15, 2026 License: EPL-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
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"
)
View Source
const (
	PruneModeDangling   = "dangling"
	PruneModeContainers = "containers"
	PruneModeVolumes    = "volumes"
	PruneModeAll        = "all"
)
View Source
const (
	DeployStageParsing    = "parsing"
	DeployStagePulling    = "pulling"
	DeployStageCreating   = "creating"
	DeployStageStarting   = "starting"
	DeployStagePersisting = "persisting"
	DeployStageDone       = "done"
)

Variables

View Source
var ErrControlPlaneNotFound = errors.New("control plane deployment not found")
View Source
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 IsControlPlaneDeleteBlocked

func IsControlPlaneDeleteBlocked(err error) bool

IsControlPlaneDeleteBlocked reports whether err blocks control-plane delete while provisioned.

func IsControlPlaneLifecycleBlocked

func IsControlPlaneLifecycleBlocked(err error) bool

IsControlPlaneLifecycleBlocked reports whether err blocks control-plane ms lifecycle.

func NormalizeRuntimeClassOperationStage

func NormalizeRuntimeClassOperationStage(stage string) string

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

type DeployProgressCallback func(stage string, message string)

DeployProgressCallback reports deploy stage transitions from runtime flow.

type ErrAmbiguousMicroserviceSelector

type ErrAmbiguousMicroserviceSelector struct {
	Matches []string
}

ErrAmbiguousMicroserviceSelector indicates selector matched multiple targets.

func (*ErrAmbiguousMicroserviceSelector) Error

type ErrControlPlaneDeleteBlocked

type ErrControlPlaneDeleteBlocked struct{}

ErrControlPlaneDeleteBlocked indicates DELETE /v1/system/controlplane is forbidden while provisioned.

func (*ErrControlPlaneDeleteBlocked) Error

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

type ErrControlPlaneLifecycleBlocked

type ErrControlPlaneLifecycleBlocked struct {
	Operation string
}

ErrControlPlaneLifecycleBlocked indicates ms rm/stop/kill/start/restart on the controller UUID is forbidden.

func (*ErrControlPlaneLifecycleBlocked) Error

type ErrReservedRuntimeClassDelete

type ErrReservedRuntimeClassDelete struct {
	Name string
}

func (*ErrReservedRuntimeClassDelete) Details

func (e *ErrReservedRuntimeClassDelete) Details() map[string]any

func (*ErrReservedRuntimeClassDelete) Error

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

type ErrRuntimeClassOperation struct {
	Stage string
	Err   error
}

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 NewFacade

func NewFacade() *Facade

NewFacade returns a singleton-backed runtime facade.

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

func (f *Facade) ApplyLocalRegistryManifest(manifest string, dryRun bool) (*models.Registry, error)

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

func (f *Facade) DeleteControlPlane() error

DeleteControlPlane removes the controller deployment, container, and volumes.

func (*Facade) DeleteLocalDeployment

func (f *Facade) DeleteLocalDeployment(id string) error

DeleteLocalDeployment removes local deployment by id.

func (*Facade) DeleteRegistry

func (f *Facade) DeleteRegistry(id int) error

DeleteRegistry removes one local registry entry.

func (*Facade) DeleteRuntimeClass

func (f *Facade) DeleteRuntimeClass(name string) error

DeleteRuntimeClass removes one RuntimeClass entry by name.

func (*Facade) Deprovision

func (f *Facade) Deprovision(scope string) error

Deprovision deprovisions the agent.

func (*Facade) GetControlPlaneDeployment

func (f *Facade) GetControlPlaneDeployment() (*models.ControlPlaneDeployment, error)

GetControlPlaneDeployment returns the singleton control plane row.

func (*Facade) GetControlPlaneManifestMasked

func (f *Facade) GetControlPlaneManifestMasked() (string, error)

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

func (f *Facade) GetRegistry(id int) (*models.Registry, error)

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

func (f *Facade) GetRuntimeMicroservice(id string) (map[string]any, error)

GetRuntimeMicroservice returns one process-manager tracked microservice.

func (*Facade) GetRuntimeMicroserviceLogs

func (f *Facade) GetRuntimeMicroserviceLogs(selector string, tailLines int, since, until string) (string, []map[string]any, error)

func (*Facade) KillRuntimeMicroservice

func (f *Facade) KillRuntimeMicroservice(selector string) (string, error)

func (*Facade) ListImages

func (f *Facade) ListImages() ([]map[string]any, error)

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

func (f *Facade) ListRegistries() ([]*models.Registry, error)

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

func (f *Facade) ListRuntimeMicroservices() []map[string]any

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) Provision

func (f *Facade) Provision(provisioningKey string) error

Provision provisions the agent.

func (*Facade) Prune

func (f *Facade) Prune(mode string) (map[string]any, error)

Prune triggers runtime prune for the requested mode.

func (*Facade) PullImage

func (f *Facade) PullImage(imageRef string, registryID *int, platform string) (string, error)

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

func (f *Facade) RemoveImage(selector string) (string, error)

RemoveImage removes an image by selector (id, id prefix, name:tag, or digest).

func (*Facade) RemoveRuntimeMicroservice

func (f *Facade) RemoveRuntimeMicroservice(selector string) (string, error)

func (*Facade) ResolveMicroserviceID

func (f *Facade) ResolveMicroserviceID(selector string) (string, error)

ResolveMicroserviceID resolves selectors in this order: exact UUID -> container ID prefix -> exact ApplicationName.MicroserviceName.

func (*Facade) RestartRuntimeMicroservice

func (f *Facade) RestartRuntimeMicroservice(selector string) (string, error)

func (*Facade) StartRuntimeMicroservice

func (f *Facade) StartRuntimeMicroservice(selector string) (string, error)

func (*Facade) StopRuntimeMicroservice

func (f *Facade) StopRuntimeMicroservice(selector string) (string, error)

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.

Jump to

Keyboard shortcuts

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