File tree Expand file tree Collapse file tree 2 files changed +6
-27
lines changed Expand file tree Collapse file tree 2 files changed +6
-27
lines changed Original file line number Diff line number Diff line change 33package system
44
55import (
6- "fmt"
7- "os"
8-
96 "github.com/containers/podman/v5/cmd/podman/registry"
107 "github.com/containers/podman/v5/cmd/podman/validate"
11- "github.com/containers/podman/v5/libpod/define"
128 "github.com/containers/podman/v5/pkg/domain/entities"
139 "github.com/spf13/cobra"
1410 "go.podman.io/common/pkg/completion"
3026 Args : validate .NoArgs ,
3127 Short : "Migrate containers" ,
3228 Long : migrateDescription ,
33- Run : migrate ,
29+ RunE : migrate ,
3430 ValidArgsFunction : completion .AutocompleteNone ,
3531 }
3632)
@@ -52,13 +48,6 @@ func init() {
5248 _ = migrateCommand .RegisterFlagCompletionFunc (newRuntimeFlagName , completion .AutocompleteNone )
5349}
5450
55- func migrate (cmd * cobra.Command , args []string ) {
56- if err := registry .ContainerEngine ().Migrate (registry .Context (), migrateOptions ); err != nil {
57- fmt .Println (err )
58-
59- // FIXME change this to return the error like other commands
60- // defer will never run on os.Exit()
61- os .Exit (define .ExecErrorCodeGeneric )
62- }
63- os .Exit (0 )
51+ func migrate (cmd * cobra.Command , args []string ) error {
52+ return registry .ContainerEngine ().Migrate (registry .Context (), migrateOptions )
6453}
Original file line number Diff line number Diff line change 33package system
44
55import (
6- "fmt"
7- "os"
8-
96 "github.com/containers/podman/v5/cmd/podman/registry"
107 "github.com/containers/podman/v5/cmd/podman/validate"
11- "github.com/containers/podman/v5/libpod/define"
128 "github.com/spf13/cobra"
139 "go.podman.io/common/pkg/completion"
1410)
2723 Args : validate .NoArgs ,
2824 Short : "Migrate lock numbers" ,
2925 Long : renumberDescription ,
30- Run : renumber ,
26+ RunE : renumber ,
3127 ValidArgsFunction : completion .AutocompleteNone ,
3228 }
3329)
@@ -39,12 +35,6 @@ func init() {
3935 })
4036}
4137
42- func renumber (cmd * cobra.Command , args []string ) {
43- if err := registry .ContainerEngine ().Renumber (registry .Context ()); err != nil {
44- fmt .Println (err )
45- // FIXME change this to return the error like other commands
46- // defer will never run on os.Exit()
47- os .Exit (define .ExecErrorCodeGeneric )
48- }
49- os .Exit (0 )
38+ func renumber (cmd * cobra.Command , args []string ) error {
39+ return registry .ContainerEngine ().Renumber (registry .Context ())
5040}
You can’t perform that action at this time.
0 commit comments