diff options
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/podman-mac-helper/install.go | 2 | ||||
-rw-r--r-- | cmd/podman/common/create.go | 16 | ||||
-rw-r--r-- | cmd/podman/images/import.go | 16 | ||||
-rw-r--r-- | cmd/podman/images/load.go | 4 | ||||
-rw-r--r-- | cmd/podman/images/scp.go | 2 | ||||
-rw-r--r-- | cmd/podman/inspect/inspect.go | 2 | ||||
-rw-r--r-- | cmd/podman/machine/init.go | 2 | ||||
-rw-r--r-- | cmd/podman/machine/set.go | 2 | ||||
-rw-r--r-- | cmd/podman/play/kube.go | 14 | ||||
-rw-r--r-- | cmd/podman/pods/create.go | 2 | ||||
-rw-r--r-- | cmd/podman/secrets/inspect.go | 2 | ||||
-rw-r--r-- | cmd/podman/system/dial_stdio.go | 4 | ||||
-rw-r--r-- | cmd/podman/utils/error.go | 2 |
13 files changed, 46 insertions, 24 deletions
diff --git a/cmd/podman-mac-helper/install.go b/cmd/podman-mac-helper/install.go index 7f623ecb6..a1b99e66c 100644 --- a/cmd/podman-mac-helper/install.go +++ b/cmd/podman-mac-helper/install.go @@ -197,7 +197,7 @@ func installExecutable(user string) (string, error) { // suffix. The goal is to help users harden against privilege escalation from loose // filesystem permissions. // - // Since userpsace package management tools, such as brew, delegate management of system + // Since userspace package management tools, such as brew, delegate management of system // paths to standard unix users, the daemon executable is copied into a separate more // restricted area of the filesystem. if err := verifyRootDeep(installPrefix); err != nil { diff --git a/cmd/podman/common/create.go b/cmd/podman/common/create.go index 8d9a255ec..afaa1942e 100644 --- a/cmd/podman/common/create.go +++ b/cmd/podman/common/create.go @@ -394,14 +394,6 @@ func DefineCreateFlags(cmd *cobra.Command, cf *entities.ContainerCreateOptions, ) _ = cmd.RegisterFlagCompletionFunc(platformFlagName, completion.AutocompleteNone) - podFlagName := "pod" - createFlags.StringVar( - &cf.Pod, - podFlagName, "", - "Run container in an existing pod", - ) - _ = cmd.RegisterFlagCompletionFunc(podFlagName, AutocompletePods) - podIDFileFlagName := "pod-id-file" createFlags.StringVar( &cf.PodIDFile, @@ -837,6 +829,14 @@ func DefineCreateFlags(cmd *cobra.Command, cf *entities.ContainerCreateOptions, ) _ = cmd.RegisterFlagCompletionFunc(nameFlagName, completion.AutocompleteNone) + podFlagName := "pod" + createFlags.StringVar( + &cf.Pod, + podFlagName, "", + "Run container in an existing pod", + ) + _ = cmd.RegisterFlagCompletionFunc(podFlagName, AutocompletePods) + cpuPeriodFlagName := "cpu-period" createFlags.Uint64Var( &cf.CPUPeriod, diff --git a/cmd/podman/images/import.go b/cmd/podman/images/import.go index a7416e298..1910fef6d 100644 --- a/cmd/podman/images/import.go +++ b/cmd/podman/images/import.go @@ -76,6 +76,18 @@ func importFlags(cmd *cobra.Command) { flags.StringVarP(&importOpts.Message, messageFlagName, "m", "", "Set commit message for imported image") _ = cmd.RegisterFlagCompletionFunc(messageFlagName, completion.AutocompleteNone) + osFlagName := "os" + flags.StringVar(&importOpts.OS, osFlagName, "", "Set the OS of the imported image") + _ = cmd.RegisterFlagCompletionFunc(osFlagName, completion.AutocompleteNone) + + archFlagName := "arch" + flags.StringVar(&importOpts.Architecture, archFlagName, "", "Set the architecture of the imported image") + _ = cmd.RegisterFlagCompletionFunc(archFlagName, completion.AutocompleteNone) + + variantFlagName := "variant" + flags.StringVar(&importOpts.Variant, variantFlagName, "", "Set the variant of the imported image") + _ = cmd.RegisterFlagCompletionFunc(variantFlagName, completion.AutocompleteNone) + flags.BoolVarP(&importOpts.Quiet, "quiet", "q", false, "Suppress output") if !registry.IsRemote() { flags.StringVar(&importOpts.SignaturePolicy, "signature-policy", "", "Path to a signature-policy file") @@ -106,14 +118,14 @@ func importCon(cmd *cobra.Command, args []string) error { if source == "-" { outFile, err := ioutil.TempFile("", "podman") if err != nil { - return errors.Errorf("error creating file %v", err) + return errors.Errorf("creating file %v", err) } defer os.Remove(outFile.Name()) defer outFile.Close() _, err = io.Copy(outFile, os.Stdin) if err != nil { - return errors.Errorf("error copying file %v", err) + return errors.Errorf("copying file %v", err) } source = outFile.Name() } diff --git a/cmd/podman/images/load.go b/cmd/podman/images/load.go index bbcfe93ce..30f88b02b 100644 --- a/cmd/podman/images/load.go +++ b/cmd/podman/images/load.go @@ -95,14 +95,14 @@ func load(cmd *cobra.Command, args []string) error { } outFile, err := ioutil.TempFile(util.Tmpdir(), "podman") if err != nil { - return errors.Errorf("error creating file %v", err) + return errors.Errorf("creating file %v", err) } defer os.Remove(outFile.Name()) defer outFile.Close() _, err = io.Copy(outFile, os.Stdin) if err != nil { - return errors.Errorf("error copying file %v", err) + return errors.Errorf("copying file %v", err) } loadOpts.Input = outFile.Name() } diff --git a/cmd/podman/images/scp.go b/cmd/podman/images/scp.go index 152275c68..51a9d1c4e 100644 --- a/cmd/podman/images/scp.go +++ b/cmd/podman/images/scp.go @@ -268,7 +268,7 @@ func saveToRemote(image, localFile string, tag string, uri *urlP.URL, iden strin } n, err := scpD.CopyFrom(dial, remoteFile, localFile) if _, conErr := connection.ExecRemoteCommand(dial, "rm "+remoteFile); conErr != nil { - logrus.Errorf("Error removing file on endpoint: %v", conErr) + logrus.Errorf("Removing file on endpoint: %v", conErr) } if err != nil { errOut := strconv.Itoa(int(n)) + " Bytes copied before error" diff --git a/cmd/podman/inspect/inspect.go b/cmd/podman/inspect/inspect.go index ef8a06163..b26b2d667 100644 --- a/cmd/podman/inspect/inspect.go +++ b/cmd/podman/inspect/inspect.go @@ -231,7 +231,7 @@ func (i *inspector) inspect(namesOrIDs []string) error { fmt.Fprintf(os.Stderr, "error inspecting object: %v\n", err) } } - return errors.Errorf("error inspecting object: %v", errs[0]) + return errors.Errorf("inspecting object: %v", errs[0]) } return nil } diff --git a/cmd/podman/machine/init.go b/cmd/podman/machine/init.go index e07b6fbfa..8fb17cf54 100644 --- a/cmd/podman/machine/init.go +++ b/cmd/podman/machine/init.go @@ -102,7 +102,7 @@ func init() { _ = initCmd.RegisterFlagCompletionFunc(IgnitionPathFlagName, completion.AutocompleteDefault) rootfulFlagName := "rootful" - flags.BoolVar(&initOpts.Rootful, rootfulFlagName, false, "Whether this machine should prefer rootful container exectution") + flags.BoolVar(&initOpts.Rootful, rootfulFlagName, false, "Whether this machine should prefer rootful container execution") } // TODO should we allow for a users to append to the qemu cmdline? diff --git a/cmd/podman/machine/set.go b/cmd/podman/machine/set.go index 4a05a9c1c..4c15f1de1 100644 --- a/cmd/podman/machine/set.go +++ b/cmd/podman/machine/set.go @@ -17,7 +17,7 @@ var ( Long: "Sets an updatable virtual machine setting", RunE: setMachine, Args: cobra.MaximumNArgs(1), - Example: `podman machine set --root=false`, + Example: `podman machine set --rootful=false`, ValidArgsFunction: completion.AutocompleteNone, } ) diff --git a/cmd/podman/play/kube.go b/cmd/podman/play/kube.go index 3067f0d54..e92516eb4 100644 --- a/cmd/podman/play/kube.go +++ b/cmd/podman/play/kube.go @@ -209,10 +209,15 @@ func teardown(yamlfile string) error { podRmErrors utils.OutputErrors ) options := new(entities.PlayKubeDownOptions) - reports, err := registry.ContainerEngine().PlayKubeDown(registry.GetContext(), yamlfile, *options) + f, err := os.Open(yamlfile) if err != nil { return err } + defer f.Close() + reports, err := registry.ContainerEngine().PlayKubeDown(registry.GetContext(), f, *options) + if err != nil { + return errors.Wrap(err, yamlfile) + } // Output stopped pods fmt.Println("Pods stopped:") @@ -242,10 +247,15 @@ func teardown(yamlfile string) error { } func playkube(yamlfile string) error { - report, err := registry.ContainerEngine().PlayKube(registry.GetContext(), yamlfile, kubeOptions.PlayKubeOptions) + f, err := os.Open(yamlfile) if err != nil { return err } + defer f.Close() + report, err := registry.ContainerEngine().PlayKube(registry.GetContext(), f, kubeOptions.PlayKubeOptions) + if err != nil { + return errors.Wrap(err, yamlfile) + } // Print volumes report for i, volume := range report.Volumes { if i == 0 { diff --git a/cmd/podman/pods/create.go b/cmd/podman/pods/create.go index ab3a6d578..b45ed0d39 100644 --- a/cmd/podman/pods/create.go +++ b/cmd/podman/pods/create.go @@ -179,7 +179,7 @@ func create(cmd *cobra.Command, args []string) error { return errors.Errorf("pod id file exists. Ensure another pod is not using it or delete %s", podIDFile) } if err != nil { - return errors.Errorf("error opening pod-id-file %s", podIDFile) + return errors.Errorf("opening pod-id-file %s", podIDFile) } defer errorhandling.CloseQuiet(podIDFD) defer errorhandling.SyncQuiet(podIDFD) diff --git a/cmd/podman/secrets/inspect.go b/cmd/podman/secrets/inspect.go index 1948fef49..0977434f7 100644 --- a/cmd/podman/secrets/inspect.go +++ b/cmd/podman/secrets/inspect.go @@ -76,7 +76,7 @@ func inspect(cmd *cobra.Command, args []string) error { fmt.Fprintf(os.Stderr, "error inspecting secret: %v\n", err) } } - return errors.Errorf("error inspecting secret: %v", errs[0]) + return errors.Errorf("inspecting secret: %v", errs[0]) } return nil } diff --git a/cmd/podman/system/dial_stdio.go b/cmd/podman/system/dial_stdio.go index f3445a49d..8b665bedc 100644 --- a/cmd/podman/system/dial_stdio.go +++ b/cmd/podman/system/dial_stdio.go @@ -88,10 +88,10 @@ func runDialStdio() error { func copier(to halfWriteCloser, from halfReadCloser, debugDescription string) error { defer func() { if err := from.CloseRead(); err != nil { - logrus.Errorf("error while CloseRead (%s): %v", debugDescription, err) + logrus.Errorf("while CloseRead (%s): %v", debugDescription, err) } if err := to.CloseWrite(); err != nil { - logrus.Errorf("error while CloseWrite (%s): %v", debugDescription, err) + logrus.Errorf("while CloseWrite (%s): %v", debugDescription, err) } }() if _, err := io.Copy(to, from); err != nil { diff --git a/cmd/podman/utils/error.go b/cmd/podman/utils/error.go index b3b54876f..2aaa71373 100644 --- a/cmd/podman/utils/error.go +++ b/cmd/podman/utils/error.go @@ -41,5 +41,5 @@ func ExitCodeFromBuildError(errorMsg string) (int, error) { return buildahCLI.ExecErrorCodeGeneric, err } } - return buildahCLI.ExecErrorCodeGeneric, errors.New("error message does not contains a valid exit code") + return buildahCLI.ExecErrorCodeGeneric, errors.New("message does not contains a valid exit code") } |