Documentation
¶
Index ¶
- type ExecInInstanceCall
- type FakeOrchestrator
- func (fo *FakeOrchestrator) AddInstance(instance *types.Instance)
- func (fo *FakeOrchestrator) AddService(service *types.Service)
- func (fo *FakeOrchestrator) CreateScalingOperation(ctx context.Context, service *types.Service, ...) error
- func (fo *FakeOrchestrator) CreateService(ctx context.Context, service *types.Service) error
- func (fo *FakeOrchestrator) DeleteService(ctx context.Context, request *types.DeletionRequest) (*types.DeletionResponse, error)
- func (fo *FakeOrchestrator) ExecInInstance(ctx context.Context, namespace, instanceID string, options types.ExecOptions) (types.ExecStream, error)
- func (fo *FakeOrchestrator) ExecInService(ctx context.Context, namespace, serviceName string, options types.ExecOptions) (types.ExecStream, error)
- func (fo *FakeOrchestrator) GetActiveScalingOperation(ctx context.Context, namespace, serviceName string) (*types.ScalingOperation, error)
- func (fo *FakeOrchestrator) GetDeletionStatus(ctx context.Context, namespace, deletionID string) (*types.DeletionOperation, error)
- func (fo *FakeOrchestrator) GetInstanceByID(ctx context.Context, namespace, instanceID string) (*types.Instance, error)
- func (fo *FakeOrchestrator) GetInstanceLogs(ctx context.Context, namespace, instanceID string, options types.LogOptions) (io.ReadCloser, error)
- func (fo *FakeOrchestrator) GetInstanceStatus(ctx context.Context, namespace, instanceID string) (*types.InstanceStatusInfo, error)
- func (fo *FakeOrchestrator) GetService(ctx context.Context, namespace, name string) (*types.Service, error)
- func (fo *FakeOrchestrator) GetServiceLogs(ctx context.Context, namespace, name string, opts types.LogOptions) (io.ReadCloser, error)
- func (fo *FakeOrchestrator) GetServiceStatus(ctx context.Context, namespace, serviceName string) (*types.ServiceStatusInfo, error)
- func (fo *FakeOrchestrator) ListDeletionOperations(ctx context.Context, namespace string) ([]*types.DeletionOperation, error)
- func (fo *FakeOrchestrator) ListInstances(ctx context.Context, namespace string) ([]*types.Instance, error)
- func (fo *FakeOrchestrator) ListRunningInstances(ctx context.Context, namespace string) ([]*types.Instance, error)
- func (fo *FakeOrchestrator) ListServices(ctx context.Context, namespace string) ([]*types.Service, error)
- func (fo *FakeOrchestrator) RestartInstance(ctx context.Context, namespace, instanceID string) error
- func (fo *FakeOrchestrator) RestartService(ctx context.Context, namespace, serviceName string) error
- func (fo *FakeOrchestrator) ScaleService(ctx context.Context, namespace, name string, scale int) error
- func (fo *FakeOrchestrator) SetEndpointPublisher(_ controllers.EndpointPublisher, _ string)
- func (fo *FakeOrchestrator) SetMountResolver(_ controllers.MountResolver)
- func (fo *FakeOrchestrator) Start(ctx context.Context) error
- func (fo *FakeOrchestrator) Stop() error
- func (fo *FakeOrchestrator) StopInstance(ctx context.Context, namespace, instanceID string) error
- func (fo *FakeOrchestrator) StopService(ctx context.Context, namespace, serviceName string) error
- func (fo *FakeOrchestrator) UpdateService(ctx context.Context, service *types.Service) error
- func (fo *FakeOrchestrator) WatchServices(ctx context.Context, namespace string) (<-chan store.WatchEvent, error)
- type Orchestrator
- type OrchestratorOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExecInInstanceCall ¶
type ExecInInstanceCall struct {
Namespace string
ServiceID string
InstanceID string
Options types.ExecOptions
Stream types.ExecStream
Error error
}
ExecInInstanceCall tracks ExecInInstance calls
type FakeOrchestrator ¶
type FakeOrchestrator struct {
// Exec-related fields for testing
ExecStdout []byte
ExecStderr []byte
ExecExitCode int
// Track calls for testing
ExecInInstanceCalls []ExecInInstanceCall
// contains filtered or unexported fields
}
FakeOrchestrator provides a simple fake implementation for testing It implements the Orchestrator interface
func NewFakeOrchestrator ¶
func NewFakeOrchestrator() *FakeOrchestrator
NewFakeOrchestrator creates a new fake orchestrator for testing
func (*FakeOrchestrator) AddInstance ¶
func (fo *FakeOrchestrator) AddInstance(instance *types.Instance)
AddInstance adds an instance to the fake orchestrator
func (*FakeOrchestrator) AddService ¶
func (fo *FakeOrchestrator) AddService(service *types.Service)
AddService adds a service to the fake orchestrator
func (*FakeOrchestrator) CreateScalingOperation ¶
func (fo *FakeOrchestrator) CreateScalingOperation(ctx context.Context, service *types.Service, params types.ScalingOperationParams) error
CreateScalingOperation implements Orchestrator interface
func (*FakeOrchestrator) CreateService ¶
CreateService implements Orchestrator interface
func (*FakeOrchestrator) DeleteService ¶
func (fo *FakeOrchestrator) DeleteService(ctx context.Context, request *types.DeletionRequest) (*types.DeletionResponse, error)
DeleteService implements Orchestrator interface
func (*FakeOrchestrator) ExecInInstance ¶
func (fo *FakeOrchestrator) ExecInInstance(ctx context.Context, namespace, instanceID string, options types.ExecOptions) (types.ExecStream, error)
ExecInInstance implements Orchestrator interface
func (*FakeOrchestrator) ExecInService ¶
func (fo *FakeOrchestrator) ExecInService(ctx context.Context, namespace, serviceName string, options types.ExecOptions) (types.ExecStream, error)
ExecInService implements the old orchestrator interface for compatibility
func (*FakeOrchestrator) GetActiveScalingOperation ¶
func (fo *FakeOrchestrator) GetActiveScalingOperation(ctx context.Context, namespace, serviceName string) (*types.ScalingOperation, error)
GetActiveScalingOperation implements Orchestrator interface
func (*FakeOrchestrator) GetDeletionStatus ¶
func (fo *FakeOrchestrator) GetDeletionStatus(ctx context.Context, namespace, deletionID string) (*types.DeletionOperation, error)
GetDeletionStatus implements the old orchestrator interface for compatibility
func (*FakeOrchestrator) GetInstanceByID ¶
func (fo *FakeOrchestrator) GetInstanceByID(ctx context.Context, namespace, instanceID string) (*types.Instance, error)
GetInstanceByID implements Orchestrator interface
func (*FakeOrchestrator) GetInstanceLogs ¶
func (fo *FakeOrchestrator) GetInstanceLogs(ctx context.Context, namespace, instanceID string, options types.LogOptions) (io.ReadCloser, error)
GetInstanceLogs implements Orchestrator interface
func (*FakeOrchestrator) GetInstanceStatus ¶
func (fo *FakeOrchestrator) GetInstanceStatus(ctx context.Context, namespace, instanceID string) (*types.InstanceStatusInfo, error)
GetInstanceStatus implements Orchestrator interface
func (*FakeOrchestrator) GetService ¶
func (fo *FakeOrchestrator) GetService(ctx context.Context, namespace, name string) (*types.Service, error)
GetService implements Orchestrator interface
func (*FakeOrchestrator) GetServiceLogs ¶
func (fo *FakeOrchestrator) GetServiceLogs(ctx context.Context, namespace, name string, opts types.LogOptions) (io.ReadCloser, error)
GetServiceLogs implements Orchestrator interface
func (*FakeOrchestrator) GetServiceStatus ¶
func (fo *FakeOrchestrator) GetServiceStatus(ctx context.Context, namespace, serviceName string) (*types.ServiceStatusInfo, error)
GetServiceStatus implements the old orchestrator interface for compatibility
func (*FakeOrchestrator) ListDeletionOperations ¶
func (fo *FakeOrchestrator) ListDeletionOperations(ctx context.Context, namespace string) ([]*types.DeletionOperation, error)
ListDeletionOperations implements Orchestrator interface
func (*FakeOrchestrator) ListInstances ¶
func (fo *FakeOrchestrator) ListInstances(ctx context.Context, namespace string) ([]*types.Instance, error)
ListInstances implements Orchestrator interface
func (*FakeOrchestrator) ListRunningInstances ¶
func (fo *FakeOrchestrator) ListRunningInstances(ctx context.Context, namespace string) ([]*types.Instance, error)
ListRunningInstances implements Orchestrator interface
func (*FakeOrchestrator) ListServices ¶
func (fo *FakeOrchestrator) ListServices(ctx context.Context, namespace string) ([]*types.Service, error)
ListServices implements Orchestrator interface
func (*FakeOrchestrator) RestartInstance ¶
func (fo *FakeOrchestrator) RestartInstance(ctx context.Context, namespace, instanceID string) error
RestartInstance implements Orchestrator interface
func (*FakeOrchestrator) RestartService ¶
func (fo *FakeOrchestrator) RestartService(ctx context.Context, namespace, serviceName string) error
RestartService implements the old orchestrator interface for compatibility
func (*FakeOrchestrator) ScaleService ¶
func (fo *FakeOrchestrator) ScaleService(ctx context.Context, namespace, name string, scale int) error
ScaleService updates the scale of a service in the fake orchestrator
func (*FakeOrchestrator) SetEndpointPublisher ¶
func (fo *FakeOrchestrator) SetEndpointPublisher(_ controllers.EndpointPublisher, _ string)
SetEndpointPublisher implements Orchestrator interface; no-op for the fake.
func (*FakeOrchestrator) SetMountResolver ¶
func (fo *FakeOrchestrator) SetMountResolver(_ controllers.MountResolver)
SetMountResolver implements Orchestrator interface; no-op for the fake.
func (*FakeOrchestrator) Start ¶
func (fo *FakeOrchestrator) Start(ctx context.Context) error
Start implements Orchestrator interface
func (*FakeOrchestrator) Stop ¶
func (fo *FakeOrchestrator) Stop() error
Stop implements Orchestrator interface
func (*FakeOrchestrator) StopInstance ¶
func (fo *FakeOrchestrator) StopInstance(ctx context.Context, namespace, instanceID string) error
StopInstance implements Orchestrator interface
func (*FakeOrchestrator) StopService ¶
func (fo *FakeOrchestrator) StopService(ctx context.Context, namespace, serviceName string) error
StopService implements the old orchestrator interface for compatibility
func (*FakeOrchestrator) UpdateService ¶
UpdateService implements Orchestrator interface
func (*FakeOrchestrator) WatchServices ¶
func (fo *FakeOrchestrator) WatchServices(ctx context.Context, namespace string) (<-chan store.WatchEvent, error)
WatchServices implements Orchestrator interface
type Orchestrator ¶
type Orchestrator interface {
// Lifecycle
Start(ctx context.Context) error
Stop() error
// Service operations
CreateService(ctx context.Context, service *types.Service) error
UpdateService(ctx context.Context, service *types.Service) error
DeleteService(ctx context.Context, request *types.DeletionRequest) (*types.DeletionResponse, error)
GetService(ctx context.Context, namespace, name string) (*types.Service, error)
ListServices(ctx context.Context, namespace string) ([]*types.Service, error)
// Status and monitoring
GetServiceStatus(ctx context.Context, namespace, name string) (*types.ServiceStatusInfo, error)
GetInstanceStatus(ctx context.Context, namespace, instanceID string) (*types.InstanceStatusInfo, error)
// Logs
GetServiceLogs(ctx context.Context, namespace, name string, opts types.LogOptions) (io.ReadCloser, error)
GetInstanceLogs(ctx context.Context, namespace, instanceID string, opts types.LogOptions) (io.ReadCloser, error)
// Execution
ExecInService(ctx context.Context, namespace, serviceName string, options types.ExecOptions) (types.ExecStream, error)
ExecInInstance(ctx context.Context, namespace, instanceID string, options types.ExecOptions) (types.ExecStream, error)
// Lifecycle operations
GetInstanceByID(ctx context.Context, namespace, instanceID string) (*types.Instance, error)
RestartService(ctx context.Context, namespace, serviceName string) error
RestartInstance(ctx context.Context, namespace, instanceID string) error
StopService(ctx context.Context, namespace, serviceName string) error
StopInstance(ctx context.Context, namespace, instanceID string) error
// Deletion operations
GetDeletionStatus(ctx context.Context, namespace, name string) (*types.DeletionOperation, error)
ListDeletionOperations(ctx context.Context, namespace string) ([]*types.DeletionOperation, error)
// Watch operations
WatchServices(ctx context.Context, namespace string) (<-chan store.WatchEvent, error)
// Instance operations
ListInstances(ctx context.Context, namespace string) ([]*types.Instance, error)
ListRunningInstances(ctx context.Context, namespace string) ([]*types.Instance, error)
// Scaling operations
CreateScalingOperation(ctx context.Context, service *types.Service, params types.ScalingOperationParams) error
GetActiveScalingOperation(ctx context.Context, namespace, serviceName string) (*types.ScalingOperation, error)
// SetEndpointPublisher wires the networking data plane (RUNE-063).
// Optional; nil-safe. Call once at startup before Start().
SetEndpointPublisher(publisher controllers.EndpointPublisher, nodeID string)
// SetMountResolver wires the agent-side volumes Subsystem (RUNE-069)
// into the instance controller. Optional; nil-safe. Call once at
// startup before Start().
SetMountResolver(resolver controllers.MountResolver)
}
Orchestrator interface - main entry point (simplified)
func NewDefaultOrchestrator ¶
func NewDefaultOrchestrator(store store.Store, logger log.Logger, runnerManager manager.IRunnerManager) (Orchestrator, error)
NewDefaultOrchestrator creates a new orchestrator with default options
func NewOrchestrator ¶
func NewOrchestrator(options OrchestratorOptions) (Orchestrator, error)
NewOrchestrator creates a new orchestrator
type OrchestratorOptions ¶
type OrchestratorOptions struct {
Store store.Store
Logger log.Logger
RunnerManager manager.IRunnerManager
WorkerCount int
EnableMetrics bool
// StorageDriverConfigs is the per-driver configuration block parsed from
// the runefile [storage] table. Key is the driver name as registered in
// pkg/storage/driver (e.g. "local", "local-host"); value is the opaque
// configuration map handed to the driver factory. Optional; nil-safe.
StorageDriverConfigs map[string]map[string]any
// DefaultStorageClass mirrors the runefile [storage].defaultStorageClass
// knob. *string so the empty-string case ("no cluster default") is
// distinguishable from "unset — keep built-in default".
DefaultStorageClass *string
// StoragePreserveOnDelete mirrors the runefile [storage].preserveOnDelete
// knob. When true, the volume controller demotes ReclaimPolicy:delete
// to retain for volumes provisioned by the in-tree "local" driver.
StoragePreserveOnDelete bool
}
OrchestratorOptions contains configuration for creating an orchestrator
Directories
¶
| Path | Synopsis |
|---|---|
|
Package controllers — RUNE-121 init-step orchestration for the instance controller.
|
Package controllers — RUNE-121 init-step orchestration for the instance controller. |