summaryrefslogtreecommitdiff
path: root/cmd/podman/init.go
diff options
context:
space:
mode:
authorBrent Baude <bbaude@redhat.com>2020-04-16 12:25:26 -0500
committerBrent Baude <bbaude@redhat.com>2020-04-16 15:53:58 -0500
commit241326a9a8c20ad7f2bcf651416b836e7778e090 (patch)
tree4001e8e47a022bb1b9bfbf2332c42e1aeb802f9e /cmd/podman/init.go
parent88c6fd06cd54fb9a8826306dfdf1a77e400de5de (diff)
downloadpodman-241326a9a8c20ad7f2bcf651416b836e7778e090.tar.gz
podman-241326a9a8c20ad7f2bcf651416b836e7778e090.tar.bz2
podman-241326a9a8c20ad7f2bcf651416b836e7778e090.zip
Podman V2 birth
remote podman v1 and replace with podman v2. Signed-off-by: Brent Baude <bbaude@redhat.com>
Diffstat (limited to 'cmd/podman/init.go')
-rw-r--r--cmd/podman/init.go64
1 files changed, 0 insertions, 64 deletions
diff --git a/cmd/podman/init.go b/cmd/podman/init.go
deleted file mode 100644
index 2e0b33828..000000000
--- a/cmd/podman/init.go
+++ /dev/null
@@ -1,64 +0,0 @@
-package main
-
-import (
- "github.com/containers/libpod/cmd/podman/cliconfig"
- "github.com/containers/libpod/pkg/adapter"
- "github.com/opentracing/opentracing-go"
- "github.com/pkg/errors"
- "github.com/spf13/cobra"
-)
-
-var (
- initCommand cliconfig.InitValues
- initDescription = `Initialize one or more containers, creating the OCI spec and mounts for inspection. Container names or IDs can be used.`
-
- _initCommand = &cobra.Command{
- Use: "init [flags] CONTAINER [CONTAINER...]",
- Short: "Initialize one or more containers",
- Long: initDescription,
- RunE: func(cmd *cobra.Command, args []string) error {
- initCommand.InputArgs = args
- initCommand.GlobalFlags = MainGlobalOpts
- initCommand.Remote = remoteclient
- return initCmd(&initCommand)
- },
- Args: func(cmd *cobra.Command, args []string) error {
- return checkAllLatestAndCIDFile(cmd, args, false, false)
- },
- Example: `podman init --latest
- podman init 3c45ef19d893
- podman init test1`,
- }
-)
-
-func init() {
- initCommand.Command = _initCommand
- initCommand.SetHelpTemplate(HelpTemplate())
- initCommand.SetUsageTemplate(UsageTemplate())
- flags := initCommand.Flags()
- flags.BoolVarP(&initCommand.All, "all", "a", false, "Initialize all containers")
- flags.BoolVarP(&initCommand.Latest, "latest", "l", false, "Act on the latest container podman is aware of")
- markFlagHiddenForRemoteClient("latest", flags)
-}
-
-// initCmd initializes a container
-func initCmd(c *cliconfig.InitValues) error {
- if c.Bool("trace") {
- span, _ := opentracing.StartSpanFromContext(Ctx, "initCmd")
- defer span.Finish()
- }
-
- ctx := getContext()
-
- runtime, err := adapter.GetRuntime(ctx, &c.PodmanCommand)
- if err != nil {
- return errors.Wrapf(err, "could not get runtime")
- }
- defer runtime.DeferredShutdown(false)
-
- ok, failures, err := runtime.InitContainers(ctx, c)
- if err != nil {
- return err
- }
- return printCmdResults(ok, failures)
-}