harvester

package
v0.0.0-...-7f4d65f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateContainerReport

func GenerateContainerReport(target types.TargetContainer, capabilityData map[string]types.Capability) *types.ContainerReport

GenerateContainerReport gathers capabilities data for a specific container

func RunAttachedHarvester

func RunAttachedHarvester(ctx context.Context, wg *sync.WaitGroup, targets []*types.TargetContainer, capabilities []types.AttachedCapability, resultsCh chan types.ContainerReport, opts types.ClientOptions, client dockeradapter.Client, reportID string) error

RunAttachedHarvester handles gathering AttachedCapabilities from the target containers. It creates an RPC Receiver server and RPC results channel which it will use to send results back to this method. Runs createAndRunHarvester in a goroutine for each of the requested target containers. Blocks on receiving a result from each of the target containers via the RPC results channel, when a result is received it will attempt to remove that associated attached container which performed the harvest before sending the result to the collector via the main results channel, resultsCh.

func RunDockerAPIHarvester

func RunDockerAPIHarvester(ctx context.Context, wg *sync.WaitGroup, targets []*types.TargetContainer, capabilities []dockeradapter.DockerAPICapability, resultsCh chan types.ContainerReport, client dockeradapter.Harvester) error

RunDockerAPIHarvester handles gathering DockerAPICapabilities from the target containers. It creates a ContainerReport for each target container populated with the output of the Harvest function from each capabilitie before sending the result to the collector via the main results channel, resultsCh.

Types

type AttachedContainer

type AttachedContainer struct {
	// contains filtered or unexported fields
}

AttachedContainer is a container attached to a running target container used to gather capability information

func NewAttachedContainer

func NewAttachedContainer(client dockeradapter.Client, opts types.ClientOptions, reportID string) *AttachedContainer

NewAttachedContainer returns a pointer to a harvester AttachedContainer

func (*AttachedContainer) Attach

func (a *AttachedContainer) Attach(target types.TargetContainer)

Attach creates a harvest container attached to the target container

func (*AttachedContainer) GetImage

func (a *AttachedContainer) GetImage(imageName string)

GetImage ensures that the requested image exists, pulling it if its not already present on the system

func (*AttachedContainer) Run

func (a *AttachedContainer) Run()

Run starts the attached harvester container and captures the Lumogon ContainerReport result

type AttachedContainerInterface

type AttachedContainerInterface interface {
	Attach(target types.TargetContainer)
	Run()
	Result() (*types.ContainerReport, error)
}

AttachedContainerInterface interface exposes Harvester lifecycle functions

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL