Documentation
¶
Overview ¶
Package containerd extracts container inventory from containerd API.
Index ¶
- Constants
- func New(cfg Config) standalone.Extractor
- func NewDefault() standalone.Extractor
- type Config
- type CtrdClient
- type Extractor
- func (e Extractor) Config() Config
- func (e Extractor) Ecosystem(p *extractor.Package) string
- func (e *Extractor) Extract(ctx context.Context, input *standalone.ScanInput) (inventory.Inventory, error)
- func (e Extractor) Name() string
- func (e Extractor) Requirements() *plugin.Capabilities
- func (e Extractor) ToPURL(p *extractor.Package) *purl.PackageURL
- func (e Extractor) Version() int
- type Metadata
Constants ¶
const (
// Name is the unique name of this extractor.
Name = "containers/containerd-runtime"
)
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(cfg Config) standalone.Extractor
New creates a new containerd client and returns a containerd container inventory extractor.
func NewDefault ¶ added in v0.1.7
func NewDefault() standalone.Extractor
NewDefault returns an extractor with the default config settings.
Types ¶
type Config ¶
type Config struct {
// ContainerdSocketAddr is the local path to the containerd socket.
// Used further to crete a client for containerd API.
ContainerdSocketAddr string
}
Config is the configuration for the Extractor.
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns the default configuration for the containerd extractor.
type CtrdClient ¶
type CtrdClient interface {
LoadContainer(ctx context.Context, id string) (containerd.Container, error)
NamespaceService() namespaces.Store
TaskService() tasks.TasksClient
Close() error
}
CtrdClient is an interface that provides an abstraction on top of the containerd client. Needed for testing purposes.
type Extractor ¶
type Extractor struct {
// contains filtered or unexported fields
}
Extractor implements the containerd runtime extractor.
func NewWithClient ¶
func NewWithClient(cli CtrdClient, socketAddr string) *Extractor
NewWithClient creates a new extractor with the provided containerd client. Needed for testing purposes.
func (Extractor) Ecosystem ¶ added in v0.1.3
Ecosystem returns no ecosystem since the Package is not a software package.
func (*Extractor) Extract ¶
func (e *Extractor) Extract(ctx context.Context, input *standalone.ScanInput) (inventory.Inventory, error)
Extractor extracts containers from the containerd API.
func (Extractor) Requirements ¶ added in v0.1.3
func (e Extractor) Requirements() *plugin.Capabilities
Requirements of the extractor.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package fakeclient contains a fake implementation of the containerd client for testing purposes.
|
Package fakeclient contains a fake implementation of the containerd client for testing purposes. |