Documentation
¶
Overview ¶
Package firecracker implements a Firecracker-based Provider. It supports a remote HTTP host-agent client and a stub in-memory fallback for dev/tests so Fleet/Boot can remain provider-agnostic.
Index ¶
- type Config
- type Provider
- func (p *Provider) Close() error
- func (p *Provider) Create(ctx context.Context, spec orchestrator.Spec) (orchestrator.Environment, error)
- func (p *Provider) Destroy(ctx context.Context, name string) error
- func (p *Provider) Get(ctx context.Context, name string) (orchestrator.Environment, error)
- func (p *Provider) List(ctx context.Context, prefix string) ([]orchestrator.Environment, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
BaseURL string // host agent base URL, e.g. https://agent.local
Token string // bearer token for auth
HTTPClient *http.Client // optional; defaults to http.DefaultClient
UseStub bool // force in-memory stub (for dev/tests)
DownloadURL string // optional URL to fetch the guest agent binary (forwarded to /start-agent)
}
Config configures the Firecracker provider client.
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider implements orchestrator.Provider backed by a Firecracker host agent API. If UseStub is true or BaseURL is empty, it falls back to an in-memory stub that simulates behavior without real microVMs.
func New ¶
New creates a Firecracker provider.
TODO: Default to a custom http.Client with a 30s timeout instead of http.DefaultClient (which has no timeout). Long-running calls like Create should use per-request context deadlines, but a client-level timeout prevents leaked connections on unresponsive hosts.
func (*Provider) Create ¶
func (p *Provider) Create(ctx context.Context, spec orchestrator.Spec) (orchestrator.Environment, error)
Create provisions a new sandbox.
func (*Provider) Get ¶
func (p *Provider) Get(ctx context.Context, name string) (orchestrator.Environment, error)
Get returns an existing sandbox.
func (*Provider) List ¶
func (p *Provider) List(ctx context.Context, prefix string) ([]orchestrator.Environment, error)
List returns all sandboxes matching the given prefix.