generate

package
v1.9.3 Latest Latest
Warning

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

Go to latest
Published: May 22, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const EnvVariable = "PODMAN_SYSTEMD_UNIT"

EnvVariable "PODMAN_SYSTEMD_UNIT" is set in all generated systemd units and is set to the unit's (unique) name.

Variables

This section is empty.

Functions

func CreateContainerSystemdUnit

func CreateContainerSystemdUnit(info *ContainerInfo, opts Options) (string, error)

CreateContainerSystemdUnit creates a systemd unit file for a container.

Types

type ContainerInfo

type ContainerInfo struct {
	// ServiceName of the systemd service.
	ServiceName string
	// Name or ID of the container.
	ContainerName string
	// InfraContainer of the pod.
	InfraContainer string
	// StopTimeout sets the timeout Podman waits before killing the container
	// during service stop.
	StopTimeout uint
	// RestartPolicy of the systemd unit (e.g., no, on-failure, always).
	RestartPolicy string
	// PIDFile of the service. Required for forking services. Must point to the
	// PID of the associated conmon process.
	PIDFile string
	// GenerateTimestamp, if set the generated unit file has a time stamp.
	GenerateTimestamp bool
	// BoundToServices are the services this service binds to.  Note that this
	// service runs after them.
	BoundToServices []string
	// RequiredServices are services this service requires. Note that this
	// service runs before them.
	RequiredServices []string
	// PodmanVersion for the header. Will be set internally. Will be auto-filled
	// if left empty.
	PodmanVersion string
	// Executable is the path to the podman executable. Will be auto-filled if
	// left empty.
	Executable string
	// TimeStamp at the time of creating the unit file. Will be set internally.
	TimeStamp string
	// New controls if a new container is created or if an existing one is started.
	New bool
	// CreateCommand is the full command plus arguments of the process the
	// container has been created with.
	CreateCommand []string
	// RunCommand is a post-processed variant of CreateCommand and used for
	// the ExecStart field in generic unit files.
	RunCommand string
	// EnvVariable is generate.EnvVariable and must not be set.
	EnvVariable string
}

ContainerInfo contains data required for generating a container's systemd unit file.

type Options

type Options struct {
	// When set, generate service files in the current working directory and
	// return the paths to these files instead of returning all contents in one
	// big string.
	Files bool
	// New controls if a new container is created or if an existing one is started.
	New bool
}

Options include different options to control the unit file generation.

Jump to

Keyboard shortcuts

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