MCPcopy Create free account
hub / github.com/containerd/nerdctl / stopAction

Function stopAction

cmd/nerdctl/compose/compose_stop.go:40–69  ·  view source on GitHub ↗
(cmd *cobra.Command, args []string)

Source from the content-addressed store, hash-verified

38}
39
40func stopAction(cmd *cobra.Command, args []string) error {
41 globalOptions, err := helpers.ProcessRootCmdFlags(cmd)
42 if err != nil {
43 return err
44 }
45 var opt composer.StopOptions
46
47 if cmd.Flags().Changed("timeout") {
48 timeValue, err := cmd.Flags().GetUint("timeout")
49 if err != nil {
50 return err
51 }
52 opt.Timeout = &timeValue
53 }
54
55 client, ctx, cancel, err := clientutil.NewClient(cmd.Context(), globalOptions.Namespace, globalOptions.Address)
56 if err != nil {
57 return err
58 }
59 defer cancel()
60 options, err := getComposeOptions(cmd, globalOptions.DebugFull, globalOptions.Experimental)
61 if err != nil {
62 return err
63 }
64 c, err := compose.New(client, globalOptions, options, cmd.OutOrStdout(), cmd.ErrOrStderr())
65 if err != nil {
66 return err
67 }
68 return c.Stop(ctx, opt, args)
69}

Callers

nothing calls this directly

Calls 5

ProcessRootCmdFlagsFunction · 0.92
NewClientFunction · 0.92
NewFunction · 0.92
getComposeOptionsFunction · 0.85
StopMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…