MCPcopy Index your code
hub / github.com/docker/cli / RunPluginHooks

Function RunPluginHooks

cli-plugins/manager/hooks.go:44–49  ·  view source on GitHub ↗

RunPluginHooks is the entrypoint for the hooks execution flow after a plugin command was just executed by the CLI.

(ctx context.Context, dockerCLI config.Provider, rootCmd, subCommand *cobra.Command, args []string, cmdErrorMessage string)

Source from the content-addressed store, hash-verified

42// RunPluginHooks is the entrypoint for the hooks execution flow
43// after a plugin command was just executed by the CLI.
44func RunPluginHooks(ctx context.Context, dockerCLI config.Provider, rootCmd, subCommand *cobra.Command, args []string, cmdErrorMessage string) {
45 commandName := strings.Join(args, " ")
46 flags := getNaiveFlags(args)
47
48 runHooks(ctx, dockerCLI.ConfigFile(), rootCmd, subCommand, commandName, flags, cmdErrorMessage)
49}
50
51func runHooks(ctx context.Context, cfg *configfile.ConfigFile, rootCmd, subCommand *cobra.Command, invokedCommand string, flags map[string]string, cmdErrorMessage string) {
52 nextSteps := invokeAndCollectHooks(ctx, cfg, rootCmd, subCommand, invokedCommand, flags, cmdErrorMessage)

Calls 3

getNaiveFlagsFunction · 0.85
runHooksFunction · 0.85
ConfigFileMethod · 0.65

Tested by 2

Used in the wild real call sites across dependent graphs

searching dependent graphs…