os

package
v5.0.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplyOptions

type ApplyOptions struct {
	Image string
}

ApplyOptions are the options for applying an image into a Podman machine VM

type MachineOS

type MachineOS struct {
	Args     []string
	VM       *vmconfigs.MachineConfig
	Provider vmconfigs.VMProvider
	VMName   string
	Restart  bool
}

MachineOS manages machine OS's from outside the machine.

func (*MachineOS) Apply

func (m *MachineOS) Apply(image string, opts ApplyOptions) error

Apply applies the image by sshing into the machine and running apply from inside the VM.

type Manager

type Manager interface {
	// Apply machine OS changes from an OCI image.
	Apply(image string, opts ApplyOptions) error
}

Manager is the interface for operations on a Podman machine's OS

type OSTree

type OSTree struct {
}

OSTree deals with operations on ostree based os's

func (*OSTree) Apply

func (dist *OSTree) Apply(image string, opts ApplyOptions) error

Apply takes an OCI image and does an rpm-ostree rebase on the image If no containers-transport is specified, apply will first check if the image exists locally, then default to pulling. Exec-ing out to rpm-ostree rebase requires sudo, so this means apply cannot be called within podman's user namespace if run as rootless. This means that we need to export images in containers-storage to oci-dirs We also need to do this via an exec, because if we tried to use the ABI functions, we would enter the user namespace, the rebase command would fail. The pull portion of this function essentially is a work-around for two things: 1. rpm-ostree requires you to specify the containers-transport when pulling. The pull in podman allows the behavior of os apply to match other podman commands, where you only pull if the image does not exist in storage already. 2. This works around the root/rootless issue. Podman machines are by default set up using a rootless connection. rpm-ostree needs to be run as root. If a user wants to use an image in containers-storage, rpm-ostree will look at the root storage, and not the user storage, which is unexpected behavior. Exporting to an oci-dir works around this, without nagging the user to configure the machine in rootful mode.

Jump to

Keyboard shortcuts

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