(cmd *cobra.Command, services []string)
| 39 | } |
| 40 | |
| 41 | func 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 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…