diff options
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/podman/build.go | 4 | ||||
-rw-r--r-- | cmd/podman/cliconfig/config.go | 1 | ||||
-rw-r--r-- | cmd/podman/logs.go | 3 | ||||
-rw-r--r-- | cmd/podman/main.go | 16 | ||||
-rw-r--r-- | cmd/podman/rm.go | 5 | ||||
-rw-r--r-- | cmd/podman/service.go | 1 |
6 files changed, 21 insertions, 9 deletions
diff --git a/cmd/podman/build.go b/cmd/podman/build.go index 12aedac37..b8b315c68 100644 --- a/cmd/podman/build.go +++ b/cmd/podman/build.go @@ -53,13 +53,12 @@ var ( } ) -func init() { +func initBuild() { buildCommand.Command = _buildCommand buildCommand.SetHelpTemplate(HelpTemplate()) buildCommand.SetUsageTemplate(UsageTemplate()) flags := buildCommand.Flags() flags.SetInterspersed(true) - budFlags := buildahcli.GetBudFlags(&budFlagsValues) flag := budFlags.Lookup("pull") if err := flag.Value.Set("true"); err != nil { @@ -353,6 +352,7 @@ func buildCmd(c *cliconfig.BuildValues) error { ContextDirectory: contextDir, DefaultMountsFilePath: c.GlobalFlags.DefaultMountsFile, Err: stderr, + In: os.Stdin, ForceRmIntermediateCtrs: c.ForceRm, IIDFile: c.Iidfile, Labels: c.Label, diff --git a/cmd/podman/cliconfig/config.go b/cmd/podman/cliconfig/config.go index 6bc8aa4a3..ccc30c603 100644 --- a/cmd/podman/cliconfig/config.go +++ b/cmd/podman/cliconfig/config.go @@ -260,6 +260,7 @@ type LogsValues struct { Tail int64 Timestamps bool Latest bool + UseName bool } type MountValues struct { diff --git a/cmd/podman/logs.go b/cmd/podman/logs.go index ebc53ddf8..0a86fa128 100644 --- a/cmd/podman/logs.go +++ b/cmd/podman/logs.go @@ -37,6 +37,7 @@ var ( return nil }, Example: `podman logs ctrID + podman logs --names ctrID1 ctrID2 podman logs --tail 2 mywebserver podman logs --follow=true --since 10m ctrID podman logs mywebserver mydbserver`, @@ -54,6 +55,7 @@ func init() { flags.StringVar(&logsCommand.Since, "since", "", "Show logs since TIMESTAMP") flags.Int64Var(&logsCommand.Tail, "tail", -1, "Output the specified number of LINES at the end of the logs. Defaults to -1, which prints all lines") flags.BoolVarP(&logsCommand.Timestamps, "timestamps", "t", false, "Output the timestamps in the log") + flags.BoolVarP(&logsCommand.UseName, "names", "n", false, "Output the container name in the log") markFlagHidden(flags, "details") flags.SetInterspersed(false) @@ -85,6 +87,7 @@ func logsCmd(c *cliconfig.LogsValues) error { Since: sinceTime, Tail: c.Tail, Timestamps: c.Timestamps, + UseName: c.UseName, } return runtime.Log(c, options) } diff --git a/cmd/podman/main.go b/cmd/podman/main.go index a22b01f24..3320ab72f 100644 --- a/cmd/podman/main.go +++ b/cmd/podman/main.go @@ -83,7 +83,7 @@ var rootCmd = &cobra.Command{ var MainGlobalOpts cliconfig.MainFlags -func init() { +func initCobra() { cobra.OnInitialize(initConfig) rootCmd.TraverseChildren = true rootCmd.Version = version.Version @@ -94,16 +94,20 @@ func init() { rootCmd.AddCommand(getMainCommands()...) } -func initConfig() { - // we can do more stuff in here. -} - -func before(cmd *cobra.Command, args []string) error { +func init() { if err := libpod.SetXdgDirs(); err != nil { logrus.Errorf(err.Error()) os.Exit(1) } + initBuild() + initCobra() +} + +func initConfig() { + // we can do more stuff in here. +} +func before(cmd *cobra.Command, args []string) error { // Set log level; if not log-level is provided, default to error logLevel := MainGlobalOpts.LogLevel if logLevel == "" { diff --git a/cmd/podman/rm.go b/cmd/podman/rm.go index e69565e95..644b0ef76 100644 --- a/cmd/podman/rm.go +++ b/cmd/podman/rm.go @@ -4,8 +4,10 @@ import ( "fmt" "github.com/containers/libpod/cmd/podman/cliconfig" + "github.com/containers/libpod/libpod/define" "github.com/containers/libpod/pkg/adapter" "github.com/pkg/errors" + "github.com/sirupsen/logrus" "github.com/spf13/cobra" ) @@ -77,6 +79,9 @@ func rmCmd(c *cliconfig.RmValues) error { if len(failures) > 0 { for _, err := range failures { + if errors.Cause(err) == define.ErrWillDeadlock { + logrus.Errorf("Potential deadlock detected - please run 'podman system renumber' to resolve") + } exitCode = setExitCode(err) } } diff --git a/cmd/podman/service.go b/cmd/podman/service.go index 3e0ff927f..7606e3009 100644 --- a/cmd/podman/service.go +++ b/cmd/podman/service.go @@ -143,7 +143,6 @@ func runREST(r *libpod.Runtime, uri string, timeout time.Duration) error { if err != nil { return errors.Wrapf(err, "unable to create socket %s", uri) } - defer l.Close() listener = &l } server, err := api.NewServerWithSettings(r, timeout, listener) |