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

Function copyAction

cmd/nerdctl/container/container_cp_linux.go:64–82  ·  view source on GitHub ↗
(cmd *cobra.Command, args []string)

Source from the content-addressed store, hash-verified

62}
63
64func copyAction(cmd *cobra.Command, args []string) error {
65 options, err := copyOptions(cmd, args)
66 if err != nil {
67 return err
68 }
69 if rootlessutil.IsRootless() {
70 options.GOptions.Address, err = rootlessutil.RootlessContainredSockAddress()
71 if err != nil {
72 return err
73 }
74 }
75 client, ctx, cancel, err := clientutil.NewClient(cmd.Context(), options.GOptions.Namespace, options.GOptions.Address)
76 if err != nil {
77 return err
78 }
79 defer cancel()
80
81 return container.Cp(ctx, client, options)
82}
83
84func copyOptions(cmd *cobra.Command, args []string) (types.ContainerCpOptions, error) {
85 globalOptions, err := helpers.ProcessRootCmdFlags(cmd)

Callers

nothing calls this directly

Calls 5

IsRootlessFunction · 0.92
NewClientFunction · 0.92
CpFunction · 0.92
copyOptionsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…