Documentation
¶
Index ¶
- type CNI
- func (c *CNI) Add(ctx context.Context, vmID string, vmCfg *types.VMConfig, ...) (configs []*types.NetworkConfig, retErr error)
- func (c *CNI) Delete(ctx context.Context, vmIDs []string) ([]string, error)
- func (c *CNI) GCModule() gc.Module[cniSnapshot]
- func (c *CNI) Inspect(ctx context.Context, id string) (*types.Network, error)
- func (c *CNI) List(ctx context.Context) ([]*types.Network, error)
- func (c *CNI) Prepare(_ context.Context, vmID string, _ *types.VMConfig) (string, error)
- func (c *CNI) RegisterGC(orch *gc.Orchestrator)
- func (c *CNI) Remove(ctx context.Context, vmID string, indices ...int) error
- func (c *CNI) Type() string
- func (c *CNI) Verify(_ context.Context, vmID string) error
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CNI ¶
type CNI struct {
// contains filtered or unexported fields
}
CNI implements network.Network using CNI plugins with per-VM netns + bridge + tap.
func New ¶
New creates a CNI provider; conflist loading is best-effort so Delete/Inspect/List still work when none are available — Add fails in that case.
func (*CNI) Add ¶ added in v0.4.0
func (c *CNI) Add(ctx context.Context, vmID string, vmCfg *types.VMConfig, specs ...network.AddSpec) (configs []*types.NetworkConfig, retErr error)
Add creates the netns (if absent) and allocates each NIC's CNI plumbing.
func (*CNI) GCModule ¶
GCModule returns the GC module for orphan netns and stale CNI record cleanup.
func (*CNI) Inspect ¶
Inspect returns the network record for a single network ID. Returns (nil, nil) if not found.
func (*CNI) Prepare ¶ added in v0.4.0
Prepare creates the per-VM netns; returns "" with no conflist.
func (*CNI) RegisterGC ¶
func (c *CNI) RegisterGC(orch *gc.Orchestrator)
RegisterGC registers the CNI GC module with the given Orchestrator.
type Config ¶
func (*Config) EnsureDirs ¶
Click to show internal directories.
Click to hide internal directories.