mirror of
https://github.com/containers/podman.git
synced 2025-08-20 23:44:25 +08:00

the podman generate systemd command will generate a systemd unit file based on the attributes of an existing container and user inputs. the command outputs the unit file to stdout for the user to copy or redirect. it is enabled for the remote client as well. users can set a restart policy as well as define a stop timeout override for the container. Signed-off-by: baude <bbaude@redhat.com>
30 lines
697 B
Go
30 lines
697 B
Go
package main
|
|
|
|
import (
|
|
"github.com/containers/libpod/cmd/podman/cliconfig"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var (
|
|
generateCommand cliconfig.PodmanCommand
|
|
generateDescription = "Generate structured data based for a containers and pods"
|
|
_generateCommand = &cobra.Command{
|
|
Use: "generate",
|
|
Short: "Generated structured data",
|
|
Long: generateDescription,
|
|
RunE: commandRunE(),
|
|
}
|
|
|
|
// Commands that are universally implemented
|
|
generateCommands = []*cobra.Command{
|
|
_containerKubeCommand,
|
|
_containerSystemdCommand,
|
|
}
|
|
)
|
|
|
|
func init() {
|
|
generateCommand.Command = _generateCommand
|
|
generateCommand.AddCommand(generateCommands...)
|
|
generateCommand.SetUsageTemplate(UsageTemplate())
|
|
}
|