generate

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2020 License: Apache-2.0 Imports: 12 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

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 int
	// 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
}

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