Documentation ¶
Index ¶
- Constants
- Variables
- func CleanupGVProxy(f define.VMFile) error
- func CommonSSH(username, identityPath, name string, sshPort int, inputArgs []string) error
- func CommonSSHShell(username, identityPath, name string, sshPort int, inputArgs []string) error
- func CommonSSHSilent(username, identityPath, name string, sshPort int, inputArgs []string) error
- func CommonSSHWithStdin(username, identityPath, name string, sshPort int, inputArgs []string, ...) error
- func CreateSSHKeys(writeLocation string) (string, error)
- func CreateSSHKeysPrefix(identityPath string, passThru bool, skipExisting bool, prefix ...string) (string, error)
- func DetermineMachineArch() string
- func DialNamedPipe(ctx context.Context, path string) (net.Conn, error)
- func DownloadImage(d DistributionDownload) error
- func DownloadVMImage(downloadURL *url2.URL, imageName string, localImagePath string) error
- func GetDevNullFiles() (*os.File, *os.File, error)
- func GetEnvSetString(env string, val string) string
- func GetSSHKeys(identityPath string) (string, error)
- func ParseVolumeFromPath(v string) (source, target, options string, readonly bool, err error)
- func PrintRootlessWarning(name string)
- func RemoveImageAfterExpire(dir string, expire time.Duration) error
- func SetRootful(rootful bool, name, rootfulName string) error
- func UpdatePodmanDockerSockService(mc *vmconfigs.MachineConfig) error
- func WaitAPIAndPrintInfo(forwardState APIForwardingState, name, helper, forwardSock string, ...)
- func WaitAndPingAPI(sock string)
- func WriteConfig(configPath string, v VM) error
- type APIForwardingState
- type CleanupCallback
- type ConnectionConfig
- type DistributionDownload
- type Download
- type GenericDownload
- type ImageConfig
- type InspectInfo
- type InspectOptions
- type ListOptions
- type ListResponse
- type RemoveOptions
- type ResetOptions
- type SSHOptions
- type StartOptions
- type StopOptions
- type VM
- type VirtIoFs
- type Virtualization
- type Volume
- type VolumeKind
Constants ¶
const (
DefaultMachineName string = "podman-machine-default"
)
Variables ¶
var (
ForwarderBinaryName = "gvproxy"
)
Functions ¶
func CleanupGVProxy ¶
CleanupGVProxy reads the --pid-file for gvproxy attempts to stop it
func CommonSSH ¶
CommonSSH is a common function for ssh'ing to a podman machine using system-connections and a port TODO This should probably be taught about an machineconfig to reduce input
func CommonSSHShell ¶ added in v5.0.1
func CommonSSHSilent ¶
func CommonSSHWithStdin ¶
func CreateSSHKeys ¶
CreateSSHKeys makes a priv and pub ssh key for interacting the a VM.
func CreateSSHKeysPrefix ¶
func DetermineMachineArch ¶
func DetermineMachineArch() string
func DownloadImage ¶
func DownloadImage(d DistributionDownload) error
func DownloadVMImage ¶
DownloadVMImage downloads a VM image from url to given path with download status
func GetDevNullFiles ¶
GetDevNullFiles returns pointers to Read-only and Write-only DevNull files
func GetEnvSetString ¶
func GetSSHKeys ¶
GetSSHKeys checks to see if there is a ssh key at the provided location. If not, we create the priv and pub keys. The ssh key is then returned.
func ParseVolumeFromPath ¶
ParseVolumeFromPath is a oneshot parsing of a provided volume. It follows the "rules" of the singular parsing functions
func PrintRootlessWarning ¶
func PrintRootlessWarning(name string)
func SetRootful ¶
SetRootful modifies the machine's default connection to be either rootful or rootless
func UpdatePodmanDockerSockService ¶
func UpdatePodmanDockerSockService(mc *vmconfigs.MachineConfig) error
func WaitAPIAndPrintInfo ¶
func WaitAPIAndPrintInfo(forwardState APIForwardingState, name, helper, forwardSock string, noInfo, rootful bool)
WaitAPIAndPrintInfo prints info about the machine and does a ping test on the API socket
func WaitAndPingAPI ¶
func WaitAndPingAPI(sock string)
func WriteConfig ¶
WriteConfig writes the machine's JSON config file
Types ¶
type APIForwardingState ¶
type APIForwardingState int
const ( NoForwarding APIForwardingState = iota ClaimUnsupported NotInstalled MachineLocal DockerGlobal )
type CleanupCallback ¶
type CleanupCallback struct { Funcs []func() error // contains filtered or unexported fields }
func CleanUp ¶
func CleanUp() CleanupCallback
func (*CleanupCallback) Add ¶
func (c *CleanupCallback) Add(anotherfunc func() error)
func (*CleanupCallback) CleanIfErr ¶
func (c *CleanupCallback) CleanIfErr(err *error)
func (*CleanupCallback) CleanOnSignal ¶
func (c *CleanupCallback) CleanOnSignal()
type ConnectionConfig ¶
type ConnectionConfig struct { // PodmanSocket is the exported podman service socket PodmanSocket *define.VMFile `json:"PodmanSocket"` // PodmanPipe is the exported podman service named pipe (Windows hosts only) PodmanPipe *define.VMFile `json:"PodmanPipe"` }
ConnectionConfig contains connections like sockets, etc.
type DistributionDownload ¶
type DistributionDownload interface { HasUsableCache() (bool, error) Get() *Download CleanCache() error }
func NewGenericDownloader ¶
func NewGenericDownloader(vmType define.VMType, vmName, pullPath string) (DistributionDownload, error)
NewGenericDownloader is used when the disk image is provided by the user
type Download ¶
type Download struct { Arch string Artifact define.Artifact CacheDir string CompressionType compression.ImageCompression DataDir string Format define.ImageFormat ImageName string LocalPath string LocalUncompressedFile string Sha256sum string Size int64 URL *url.URL VMKind define.VMType VMName string }
func (Download) AcquireAlternateImage ¶
AcquireAlternateImage downloads the alternate image the user provided, which can be a file path or URL
func (Download) GetLocalUncompressedFile ¶
type GenericDownload ¶
type GenericDownload struct {
Download
}
GenericDownload is used when a user provides a URL or path for an image
func (GenericDownload) CleanCache ¶
func (g GenericDownload) CleanCache() error
CleanCache cleans out downloaded uncompressed image files
func (GenericDownload) Get ¶
func (g GenericDownload) Get() *Download
func (GenericDownload) HasUsableCache ¶
func (g GenericDownload) HasUsableCache() (bool, error)
type ImageConfig ¶
type ImageConfig struct { // IgnitionFile is the path to the filesystem where the // ignition file was written (if needs one) IgnitionFile define.VMFile `json:"IgnitionFilePath"` // ImageStream is the update stream for the image ImageStream string // ImageFile is the fq path to ImagePath define.VMFile `json:"ImagePath"` }
ImageConfig describes the bootable image for the VM
type InspectInfo ¶
type InspectOptions ¶
type InspectOptions struct{}
type ListOptions ¶
type ListOptions struct{}
type ListResponse ¶
type RemoveOptions ¶
type ResetOptions ¶
type ResetOptions struct {
Force bool
}
type SSHOptions ¶
type StartOptions ¶
type StopOptions ¶
type StopOptions struct{}
type VM ¶
type VM interface { Init(opts define.InitOptions) (bool, error) Inspect() (*InspectInfo, error) Remove(name string, opts RemoveOptions) (string, func() error, error) Set(name string, opts define.SetOptions) ([]error, error) SSH(name string, opts SSHOptions) error Start(name string, opts StartOptions) error State(bypass bool) (define.Status, error) Stop(name string, opts StopOptions) error }
TODO This can be removed when WSL is refactored into podman 5
type VirtIoFs ¶
type VirtIoFs struct { VolumeKind ReadOnly bool Source string Tag string Target string }
func MountToVirtIOFs ¶
func NewVirtIoFsMount ¶
NewVirtIoFsMount describes a machine volume mount for virtio-fs. With virtio-fs the source/target are described as a "shared dir". With this style of volume mount the Tag is used as the descriptor value for the mount (in Linux).
type Virtualization ¶
type Virtualization struct {
// contains filtered or unexported fields
}
TODO THis should be able to be removed once WSL is refactored for podman5
func NewVirtualization ¶
func NewVirtualization(artifact define.Artifact, compression compression.ImageCompression, format define.ImageFormat, vmKind define.VMType) Virtualization
func (*Virtualization) Artifact ¶
func (p *Virtualization) Artifact() define.Artifact
func (*Virtualization) Compression ¶
func (p *Virtualization) Compression() compression.ImageCompression
func (*Virtualization) Format ¶
func (p *Virtualization) Format() define.ImageFormat
func (*Virtualization) NewDownload ¶
func (p *Virtualization) NewDownload(vmName string) (Download, error)
func (*Virtualization) VMType ¶
func (p *Virtualization) VMType() define.VMType
type Volume ¶
type Volume interface {
Kind() VolumeKind
}
type VolumeKind ¶
type VolumeKind string
var ( VirtIOFsVk VolumeKind = "virtiofs" NinePVk VolumeKind = "9p" )