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

Function killAction

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

Source from the content-addressed store, hash-verified

43}
44
45func killAction(cmd *cobra.Command, args []string) error {
46 globalOptions, err := helpers.ProcessRootCmdFlags(cmd)
47 if err != nil {
48 return err
49 }
50 killSignal, err := cmd.Flags().GetString("signal")
51 if err != nil {
52 return err
53 }
54 options := types.ContainerKillOptions{
55 GOptions: globalOptions,
56 KillSignal: killSignal,
57 Stdout: cmd.OutOrStdout(),
58 Stderr: cmd.ErrOrStderr(),
59 }
60
61 client, ctx, cancel, err := clientutil.NewClient(cmd.Context(), options.GOptions.Namespace, options.GOptions.Address)
62 if err != nil {
63 return err
64 }
65 defer cancel()
66
67 return container.Kill(ctx, client, args, options)
68}
69
70func killShellComplete(cmd *cobra.Command, _ []string, _ string) ([]string, cobra.ShellCompDirective) {
71 // show non-stopped container names

Callers

nothing calls this directly

Calls 3

ProcessRootCmdFlagsFunction · 0.92
NewClientFunction · 0.92
KillFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…