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

Function execAction

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

Source from the content-addressed store, hash-verified

123}
124
125func execAction(cmd *cobra.Command, args []string) error {
126 options, err := execOptions(cmd)
127 if err != nil {
128 return err
129 }
130 // simulate the behavior of double dash
131 newArg := []string{}
132 if len(args) >= 2 && args[1] == "--" {
133 newArg = append(newArg, args[:1]...)
134 newArg = append(newArg, args[2:]...)
135 args = newArg
136 }
137
138 client, ctx, cancel, err := clientutil.NewClient(cmd.Context(), options.GOptions.Namespace, options.GOptions.Address)
139 if err != nil {
140 return err
141 }
142 defer cancel()
143
144 return container.Exec(ctx, client, args, options)
145}
146
147func execShellComplete(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
148 if len(args) == 0 {

Callers

nothing calls this directly

Calls 3

NewClientFunction · 0.92
ExecFunction · 0.92
execOptionsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…