diff options
author | Valentin Rothberg <rothberg@redhat.com> | 2020-04-27 14:23:23 +0200 |
---|---|---|
committer | Valentin Rothberg <rothberg@redhat.com> | 2020-04-29 07:22:18 +0200 |
commit | b2414b580e236e011d60028e645ab41096035ee3 (patch) | |
tree | 7e639a4c40d728c3be4e65e2870f785ced13665e /cmd/podman/generate/generate.go | |
parent | bf4efc1953467907ae7d75d5f3ef3cd41505ee24 (diff) | |
download | podman-b2414b580e236e011d60028e645ab41096035ee3.tar.gz podman-b2414b580e236e011d60028e645ab41096035ee3.tar.bz2 podman-b2414b580e236e011d60028e645ab41096035ee3.zip |
generate systemd
Implement `podman generate systemd` for Podman v2 and enable associated
tests.
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'cmd/podman/generate/generate.go')
-rw-r--r-- | cmd/podman/generate/generate.go | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/cmd/podman/generate/generate.go b/cmd/podman/generate/generate.go new file mode 100644 index 000000000..f04ef58a5 --- /dev/null +++ b/cmd/podman/generate/generate.go @@ -0,0 +1,27 @@ +package pods + +import ( + "github.com/containers/libpod/cmd/podman/registry" + "github.com/containers/libpod/pkg/domain/entities" + "github.com/containers/libpod/pkg/util" + "github.com/spf13/cobra" +) + +var ( + // Command: podman _generate_ + generateCmd = &cobra.Command{ + Use: "generate", + Short: "Generate structured data based on containers and pods.", + Long: "Generate structured data (e.g., Kubernetes yaml or systemd units) based on containers and pods.", + TraverseChildren: true, + RunE: registry.SubCommandExists, + } + containerConfig = util.DefaultContainerConfig() +) + +func init() { + registry.Commands = append(registry.Commands, registry.CliCommand{ + Mode: []entities.EngineMode{entities.ABIMode}, + Command: generateCmd, + }) +} |