diff options
Diffstat (limited to 'cmd/podman')
-rw-r--r-- | cmd/podman/common/specgen.go | 12 | ||||
-rw-r--r-- | cmd/podman/images/build.go | 2 | ||||
-rw-r--r-- | cmd/podman/images/history.go | 2 | ||||
-rw-r--r-- | cmd/podman/system/connection/add.go | 2 |
4 files changed, 12 insertions, 6 deletions
diff --git a/cmd/podman/common/specgen.go b/cmd/podman/common/specgen.go index 84ae70b6a..f427830c6 100644 --- a/cmd/podman/common/specgen.go +++ b/cmd/podman/common/specgen.go @@ -575,11 +575,17 @@ func FillOutSpecGen(s *specgen.SpecGenerator, c *ContainerCLIOpts, args []string if len(split) < 2 { return errors.Errorf("invalid log option %q", o) } - switch { - case split[0] == "driver": + switch strings.ToLower(split[0]) { + case "driver": s.LogConfiguration.Driver = split[1] - case split[0] == "path": + case "path": s.LogConfiguration.Path = split[1] + case "max-size": + logSize, err := units.FromHumanSize(split[1]) + if err != nil { + return errors.Wrapf(err, "%s is not a valid option", o) + } + s.LogConfiguration.Size = logSize default: logOpts[split[0]] = split[1] } diff --git a/cmd/podman/images/build.go b/cmd/podman/images/build.go index d24bb18b6..ac1b2c848 100644 --- a/cmd/podman/images/build.go +++ b/cmd/podman/images/build.go @@ -210,7 +210,7 @@ func build(cmd *cobra.Command, args []string) error { if cmd.Flag("logfile").Changed { logfile, err := os.OpenFile(buildOpts.Logfile, os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0600) if err != nil { - return errors.Errorf("error opening logfile %q: %v", buildOpts.Logfile, err) + return err } defer logfile.Close() } diff --git a/cmd/podman/images/history.go b/cmd/podman/images/history.go index f3a41f6b9..30abf0ada 100644 --- a/cmd/podman/images/history.go +++ b/cmd/podman/images/history.go @@ -132,7 +132,7 @@ func history(cmd *cobra.Command, args []string) error { w := tabwriter.NewWriter(os.Stdout, 8, 2, 2, ' ', 0) err = tmpl.Execute(w, hr) if err != nil { - fmt.Fprintln(os.Stderr, errors.Wrapf(err, "Failed to print report")) + fmt.Fprintln(os.Stderr, errors.Wrapf(err, "failed to print report")) } w.Flush() return nil diff --git a/cmd/podman/system/connection/add.go b/cmd/podman/system/connection/add.go index 8b9ab6dbb..df036af1a 100644 --- a/cmd/podman/system/connection/add.go +++ b/cmd/podman/system/connection/add.go @@ -166,7 +166,7 @@ func getUDS(cmd *cobra.Command, uri *url.URL) (string, error) { value := cmd.Flag("identity").Value.String() auth, err := terminal.PublicKey(value, []byte(passwd)) if err != nil { - return "", errors.Wrapf(err, "Failed to read identity %q", value) + return "", errors.Wrapf(err, "failed to read identity %q", value) } authMethods = append(authMethods, auth) } |