Documentation
¶
Index ¶
- Constants
- Variables
- func Installed() error
- type Client
- type ConnectionConfig
- type Container
- type Diagnostic
- type IPNet
- type Image
- type ImageConfig
- type InspectAdditionalNetwork
- type InspectBasicNetworkConfig
- type InspectContainerConfig
- type InspectContainerData
- type InspectContainerHostConfig
- type InspectHostPort
- type InspectInfo
- type InspectMount
- type InspectNetworkSettings
- type LeaseRange
- type Network
- type ResourceConfig
- type Route
- type RunContainerOpts
- type SSHConfig
- type Schema2HealthConfig
- type Status
- type Subnet
- type VMFile
- type Version
Constants ¶
const ( Running Status = "running" DefaultMachineName string = "podman-machine-default" )
Variables ¶
var ( ErrPodmanNotFound = errors.New("podman not found in your system, check requirements at https://dochub.mongodb.org/core/atlas-cli-deploy-local-reqs") ErrNetworkNotFound = errors.New("network ip range was not found") )
Functions ¶
Types ¶
type Client ¶
type Client interface { Ready(ctx context.Context) error Diagnostics(ctx context.Context) *Diagnostic CreateNetwork(ctx context.Context, name string) ([]byte, error) CreateVolume(ctx context.Context, name string) ([]byte, error) RunContainer(ctx context.Context, opts RunContainerOpts) ([]byte, error) CopyFileToContainer(ctx context.Context, localFile string, containerName string, filePathInContainer string) ([]byte, error) ContainerInspect(ctx context.Context, names ...string) ([]*InspectContainerData, error) StopContainers(ctx context.Context, names ...string) ([]byte, error) StartContainers(ctx context.Context, names ...string) ([]byte, error) UnpauseContainers(ctx context.Context, names ...string) ([]byte, error) RemoveContainers(ctx context.Context, names ...string) ([]byte, error) RemoveVolumes(ctx context.Context, names ...string) ([]byte, error) RemoveNetworks(ctx context.Context, names ...string) ([]byte, error) ListContainers(ctx context.Context, nameFilter string) ([]*Container, error) ListImages(ctx context.Context, nameFilter string) ([]*Image, error) PullImage(ctx context.Context, name string) ([]byte, error) Version(ctx context.Context) (*Version, error) Logs(ctx context.Context) (map[string]interface{}, []error) ContainerLogs(ctx context.Context, name string) ([]string, error) Network(ctx context.Context, names ...string) ([]*Network, error) Exec(ctx context.Context, name string, args ...string) error }
type ConnectionConfig ¶
type ConnectionConfig struct { // PodmanSocket is the exported podman service socket PodmanSocket *VMFile `json:"PodmanSocket"` // PodmanPipe is the exported podman service named pipe (Windows hosts only) PodmanPipe *VMFile `json:"PodmanPipe"` }
ConnectionConfig contains connections like sockets, etc.
type Diagnostic ¶
type IPNet ¶
IPNet is used as custom net.IPNet type to add Marshal/Unmarshal methods.
func (*IPNet) MarshalText ¶
func (*IPNet) UnmarshalText ¶
type Image ¶
type Image struct { ID string `json:"ID"` RepoTags string `json:"RepoTags"` RepoDigests []string `json:"RepoDigests"` Created int `json:"Created"` CreatedAt string `json:"CreatedAt"` Size int `json:"Size"` VirtualSize int `json:"VirtualSize"` Labels struct { Architecture string `json:"architecture"` BuildDate string `json:"build-date"` Description string `json:"description"` Name string `json:"name"` Version string `json:"version"` } `json:"Labels"` Containers int `json:"Containers"` Names []string }
type ImageConfig ¶
type ImageConfig struct { // IgnitionFile is the path to the filesystem where the // ignition file was written (if needs one) IgnitionFile VMFile `json:"IgnitionFilePath"` // ImageStream is the update stream for the image ImageStream string // ImageFile is the fq path to ImagePath VMFile `json:"ImagePath"` }
ImageConfig describes the bootable image for the VM.
type InspectAdditionalNetwork ¶
type InspectAdditionalNetwork struct {
InspectBasicNetworkConfig
}
InspectAdditionalNetwork holds information about non-default networks the container has been connected to. As with InspectNetworkSettings, many fields are unused and maintained only for compatibility with Docker.
type InspectBasicNetworkConfig ¶
type InspectBasicNetworkConfig struct { // IPAddress is the IP address for this network. IPAddress string `json:"IPAddress"` }
InspectBasicNetworkConfig holds basic configuration information (e.g. IP addresses, MAC address, subnet masks, etc) that are common for all networks (both additional and main).
type InspectContainerConfig ¶
InspectContainerConfig holds further data about how a container was initially configured.
type InspectContainerData ¶
type InspectContainerData struct { // Name is the name of the secret Name string `json:"Name"` Mounts []InspectMount `json:"Mounts"` NetworkSettings *InspectNetworkSettings `json:"NetworkSettings"` Config *InspectContainerConfig `json:"Config"` HostConfig *InspectContainerHostConfig `json:"HostConfig"` }
InspectContainerData provides a detailed record of a container's configuration and state as viewed by Libpod. Large portions of this structure are defined such that the output is compatible with `docker inspect` JSON, but additional fields have been added as required to share information not in the original output.
type InspectContainerHostConfig ¶
type InspectContainerHostConfig struct { // PortBindings contains the container's port bindings. // It is formatted as map[string][]InspectHostPort. // The string key here is formatted as <integer port number>/<protocol> // and represents the container port. A single container port may be // bound to multiple host ports (on different IPs). PortBindings map[string][]InspectHostPort `json:"PortBindings"` }
InspectContainerHostConfig holds information used when the container was created. It's very much a Docker-specific struct, retained (mostly) as-is for compatibility. We fill individual fields as best as we can, inferring as much as possible from the spec and container config. Some things cannot be inferred. These will be populated by spec annotations (if available).
type InspectHostPort ¶
type InspectHostPort struct { // IP on the host we are bound to. "" if not specified (binding to all // IPs). HostIP string `json:"HostIp"` // Port on the host we are bound to. No special formatting - just an // integer stuffed into a string. HostPort string `json:"HostPort"` }
InspectHostPort provides information on a port on the host that a container's port is bound to.
type InspectInfo ¶
type InspectInfo struct { ConfigPath VMFile ConnectionInfo ConnectionConfig Created time.Time Image ImageConfig LastUp time.Time Name string Resources ResourceConfig SSHConfig SSHConfig State Status UserModeNetworking bool Rootful bool }
type InspectMount ¶
type InspectMount struct { // The name of the volume. Empty for bind mounts. Name string `json:"Name,omitempty"` }
InspectMount provides a record of a single mount in a container. It contains fields for both named and normal volumes. Only user-specified volumes will be included, and tmpfs volumes are not included even if the user specified them.
type InspectNetworkSettings ¶
type InspectNetworkSettings struct { InspectBasicNetworkConfig // Networks contains information on non-default networks this // container has joined. // It is a map of network name to network information. Networks map[string]*InspectAdditionalNetwork `json:"Networks,omitempty"` }
InspectNetworkSettings holds information about the network settings of the container. Many fields are maintained only for compatibility with `docker inspect` and are unused within Libpod.
type LeaseRange ¶
type LeaseRange struct { // StartIP first IP in the subnet which should be used to assign ips. // swagger:strfmt string StartIP net.IP `json:"start_ip,omitempty"` // EndIP last IP in the subnet which should be used to assign ips. // swagger:strfmt string EndIP net.IP `json:"end_ip,omitempty"` }
LeaseRange contains the range where IP are leased.
type Network ¶
type Network struct { // Name of the Network. Name string `json:"name"` // ID of the Network. ID string `json:"id"` // Driver for this Network, e.g. bridge, macvlan... Driver string `json:"driver"` // NetworkInterface is the network interface name on the host. NetworkInterface string `json:"network_interface,omitempty"` // Created contains the timestamp when this network was created. Created time.Time `json:"created,omitempty"` // Subnets to use for this network. Subnets []Subnet `json:"subnets,omitempty"` // Routes to use for this network. Routes []Route `json:"routes,omitempty"` // IPv6Enabled if set to true an ipv6 subnet should be created for this net. IPv6Enabled bool `json:"ipv6_enabled"` // Internal is whether the Network should not have external routes // to public or other Networks. Internal bool `json:"internal"` // DNSEnabled is whether name resolution is active for container on // this Network. Only supported with the bridge driver. DNSEnabled bool `json:"dns_enabled"` // List of custom DNS server for podman's DNS resolver at network level, // all the containers attached to this network will consider resolvers // configured at network level. NetworkDNSServers []string `json:"network_dns_servers,omitempty"` // Labels is a set of key-value labels that have been applied to the // Network. Labels map[string]string `json:"labels,omitempty"` // Options is a set of key-value options that have been applied to // the Network. Options map[string]string `json:"options,omitempty"` // IPAMOptions contains options used for the ip assignment. IPAMOptions map[string]string `json:"ipam_options,omitempty"` }
Network describes the Network attributes.
type ResourceConfig ¶
type ResourceConfig struct { // CPUs to be assigned to the VM CPUs uint64 // Disk size in gigabytes assigned to the vm DiskSize uint64 // Memory in megabytes assigned to the vm Memory uint64 }
ResourceConfig describes physical attributes of the machine.
type RunContainerOpts ¶
type RunContainerOpts struct { Detach bool Remove bool Image string Name string Hostname string // map[hostVolume, pathInContainer] Volumes map[string]string // map[hostPort, containerPort] Ports map[int]int BindIPAll bool Network string EnvVars map[string]string Args []string Entrypoint string Cmd string IP string }
type SSHConfig ¶
type SSHConfig struct { // IdentityPath is the fq path to the ssh priv key IdentityPath string // SSH port for user networking Port int // RemoteUsername of the vm user RemoteUsername string }
SSHConfig contains remote access information for SSH.
type Schema2HealthConfig ¶
type Schema2HealthConfig struct { // Test is the test to perform to check that the container is healthy. // An empty slice means to inherit the default. // The options are: // {} : inherit healthcheck // {"NONE"} : disable healthcheck // {"CMD", args...} : exec arguments directly // {"CMD-SHELL", command} : run command with system's default shell Test []string `json:",omitempty"` // Zero means to inherit. Durations are expressed as integer nanoseconds. StartPeriod time.Duration `json:",omitempty"` // StartPeriod is the time to wait after starting before running the first check. Interval time.Duration `json:",omitempty"` // Interval is the time to wait between checks. Timeout time.Duration `json:",omitempty"` // Timeout is the time to wait before considering the check to have hung. // Retries is the number of consecutive failures needed to consider a container as unhealthy. // Zero means inherit. Retries int `json:",omitempty"` }
Schema2HealthConfig is a HealthConfig, which holds configuration settings for the HEALTHCHECK feature, from docker/docker/api/types/container.
type Subnet ¶
type Subnet struct { // Subnet for this Network in CIDR form. // swagger:strfmt string Subnet IPNet `json:"subnet"` // Gateway IP for this Network. // swagger:strfmt string Gateway net.IP `json:"gateway,omitempty"` // LeaseRange contains the range where IP are leased. Optional. LeaseRange *LeaseRange `json:"lease_range,omitempty"` }
type Version ¶
type Version struct { Client struct { APIVersion string `json:"APIVersion"` Version string `json:"Version"` GoVersion string `json:"GoVersion"` GitCommit string `json:"GitCommit"` BuiltTime string `json:"BuiltTime"` Built int `json:"Built"` OsArch string `json:"OsArch"` Os string `json:"Os"` } `json:"Client"` Server struct { APIVersion string `json:"APIVersion"` Version string `json:"Version"` GoVersion string `json:"GoVersion"` GitCommit string `json:"GitCommit"` BuiltTime string `json:"BuiltTime"` Built int `json:"Built"` OsArch string `json:"OsArch"` Os string `json:"Os"` } `json:"Server"` }