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

Function configAction

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

Source from the content-addressed store, hash-verified

46}
47
48func configAction(cmd *cobra.Command, args []string) error {
49 globalOptions, err := helpers.ProcessRootCmdFlags(cmd)
50 if err != nil {
51 return err
52 }
53 if len(args) != 0 {
54 // TODO: support specifying service names as args
55 return fmt.Errorf("arguments %v not supported", args)
56 }
57 quiet, err := cmd.Flags().GetBool("quiet")
58 if err != nil {
59 return err
60 }
61 services, err := cmd.Flags().GetBool("services")
62 if err != nil {
63 return err
64 }
65 volumes, err := cmd.Flags().GetBool("volumes")
66 if err != nil {
67 return err
68 }
69 hash, err := cmd.Flags().GetString("hash")
70 if err != nil {
71 return err
72 }
73
74 client, ctx, cancel, err := clientutil.NewClient(cmd.Context(), globalOptions.Namespace, globalOptions.Address)
75 if err != nil {
76 return err
77 }
78 defer cancel()
79 options, err := getComposeOptions(cmd, globalOptions.DebugFull, globalOptions.Experimental)
80 if err != nil {
81 return err
82 }
83 c, err := compose.New(client, globalOptions, options, cmd.OutOrStdout(), cmd.ErrOrStderr())
84 if err != nil {
85 return err
86 }
87
88 if quiet {
89 return nil
90 }
91 co := composer.ConfigOptions{
92 Services: services,
93 Volumes: volumes,
94 Hash: hash,
95 }
96 return c.Config(ctx, cmd.OutOrStdout(), co)
97}

Callers

nothing calls this directly

Calls 5

ProcessRootCmdFlagsFunction · 0.92
NewClientFunction · 0.92
NewFunction · 0.92
getComposeOptionsFunction · 0.85
ConfigMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…