Documentation
¶
Overview ¶
Package adopt classifies containers on a Docker host that nothing here manages and previews what adopting them would involve. It never changes the host.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Candidate ¶
type Candidate struct {
ID string `json:"id"`
Name string `json:"name"`
Kind Kind `json:"kind"`
ComposeWorkingDir string `json:"compose_working_dir,omitempty"`
ComposeFiles string `json:"compose_files,omitempty"`
Containers []Container `json:"containers"`
WouldCreate []Resource `json:"would_create"`
CannotCarry []Note `json:"cannot_carry"`
Risks []Note `json:"risks"`
Unknowns []Note `json:"unknowns"`
}
Candidate is one adoptable unit: a compose project or a standalone container.
type Container ¶
type Container struct {
ID string `json:"id"`
Name string `json:"name"`
Image string `json:"image"`
State string `json:"state"`
Kind Kind `json:"kind"`
Engine string `json:"engine,omitempty"`
Ports []Port `json:"ports"`
Mounts []Mount `json:"mounts"`
Networks []string `json:"networks"`
NetworkMode string `json:"network_mode,omitempty"`
RestartPolicy string `json:"restart_policy"`
ComposeProject string `json:"compose_project,omitempty"`
ComposeService string `json:"compose_service,omitempty"`
Env []EnvName `json:"env"`
}
Container is one unmanaged container with its classification.
type Mount ¶
type Mount struct {
Type string `json:"type"`
Name string `json:"name,omitempty"`
Source string `json:"source,omitempty"`
Target string `json:"target"`
ReadOnly bool `json:"read_only"`
}
Mount is one volume or bind mount.
type Note ¶
type Note struct {
Code string `json:"code"`
Subject string `json:"subject,omitempty"`
Message string `json:"message"`
}
Note is one coded finding; Subject names the port, path or volume it is about.
type Port ¶
type Port struct {
ContainerPort int `json:"container_port"`
Protocol string `json:"protocol"`
HostIP string `json:"host_ip,omitempty"`
HostPort int `json:"host_port,omitempty"`
}
Port is a container port; host_port 0 means exposed but not published.
type Report ¶
type Report struct {
Candidates []Candidate `json:"candidates"`
// Managed counts containers left out because this or another instance manages them.
Managed int `json:"managed_excluded"`
}
Report is the whole read-only discovery result.
func Build ¶
func Build(hosts []docker.HostContainer) Report
Build classifies the host's containers and previews each adoption. Managed ones are only counted.