Skip to main content

FleetAdmin

Trait FleetAdmin 

Source
pub trait FleetAdmin: Send + Sync {
    // Required methods
    fn add_workspace<'life0, 'async_trait>(
        &'life0 self,
        name: String,
        root: PathBuf,
        config: WorkspaceConfig,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn remove_workspace<'life0, 'life1, 'async_trait>(
        &'life0 self,
        name: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn set_workspace_config<'life0, 'life1, 'async_trait>(
        &'life0 self,
        name: &'life1 str,
        config: WorkspaceConfig,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided methods
    fn list_workspaces<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<WorkspaceInfo>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn workspace_ops_are_async(&self) -> bool { ... }
}
Expand description

The workspace-registry / provider-config plane — a prospero concept (Registry of managed workspaces). Both backends implement it: LocalFleet projects the backend-neutral [WorkspaceConfig] onto its internal single-provider RepoProviderConfig path (unchanged); K8sFleet maps the rich fields onto a Workspace custom resource. The API returns 405 only where a backend leaves the admin seam unwired. (#76, #142)

Required Methods§

Source

fn add_workspace<'life0, 'async_trait>( &'life0 self, name: String, root: PathBuf, config: WorkspaceConfig, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Register a workspace and persist it. root is the LocalFleet checkout path; k8s ignores it and uses config.sources instead.

Source

fn remove_workspace<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Unregister a workspace; returns whether one existed.

Source

fn set_workspace_config<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 str, config: WorkspaceConfig, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Replace a workspace’s configuration (local: restarts its caliband; k8s: patches the Workspace CR, operator reconciles).

Provided Methods§

Source

fn list_workspaces<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<WorkspaceInfo>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

List configured workspaces with reconciliation status, for the read side (GET /api/workspaces). The default returns empty: backends whose workspaces already appear in the fleet snapshot (local) need not duplicate them here. K8sWorkspaceAdmin overrides this to return its Workspace CRs, so a configured-but-agentless workspace is still visible with its status. (#142)

Source

fn workspace_ops_are_async(&self) -> bool

Whether workspace create/config completes asynchronously (the caller should treat success as accepted, reconciling rather than done). Local applies config synchronously (false); the k8s config plane hands off to the operator’s reconcile loop (true → the API answers 202).

Implementors§