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

Function downAction

cmd/nerdctl/compose/compose_down.go:41–76  ·  view source on GitHub ↗
(cmd *cobra.Command, services []string)

Source from the content-addressed store, hash-verified

39}
40
41func downAction(cmd *cobra.Command, services []string) error {
42 globalOptions, err := helpers.ProcessRootCmdFlags(cmd)
43 if err != nil {
44 return err
45 }
46 volumes, err := cmd.Flags().GetBool("volumes")
47 if err != nil {
48 return err
49 }
50 client, ctx, cancel, err := clientutil.NewClient(cmd.Context(), globalOptions.Namespace, globalOptions.Address)
51 if err != nil {
52 return err
53 }
54
55 removeOrphans, err := cmd.Flags().GetBool("remove-orphans")
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 options.Services = services
65
66 c, err := compose.New(client, globalOptions, options, cmd.OutOrStdout(), cmd.ErrOrStderr())
67 if err != nil {
68 return err
69 }
70
71 downOpts := composer.DownOptions{
72 RemoveVolumes: volumes,
73 RemoveOrphans: removeOrphans,
74 }
75 return c.Down(ctx, downOpts, services)
76}

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…