func delegateArgs(action string) *DelegateArgs {
	return &DelegateArgs{
		Command: action,
	}
}
return CNIArgs used by delegation
package invoke
import (
	"context"
	"os"
	"path/filepath"
	"github.com/containernetworking/cni/pkg/types"
)
func delegateCommon(delegatePlugin string, exec Exec) (string, Exec, error) {
	if exec == nil {
		exec = defaultExec
	}
	paths := filepath.SplitList(os.Getenv("CNI_PATH"))
	pluginPath, err := exec.FindInPath(delegatePlugin, paths)
	if err != nil {
		return "", nil, err
	}
	return pluginPath, exec, nil
}
func DelegateAdd(ctx context.Context, delegatePlugin string, netconf []byte, exec Exec) (types.Result, error) {
	pluginPath, realExec, err := delegateCommon(delegatePlugin, exec)
	if err != nil {
		return nil, err
	}
	return ExecPluginWithResult(ctx, pluginPath, netconf, delegateArgs("ADD"), realExec)
}
func DelegateCheck(ctx context.Context, delegatePlugin string, netconf []byte, exec Exec) error {
	pluginPath, realExec, err := delegateCommon(delegatePlugin, exec)
	if err != nil {
		return err
	}
	return ExecPluginWithoutResult(ctx, pluginPath, netconf, delegateArgs("CHECK"), realExec)
}
func DelegateDel(ctx context.Context, delegatePlugin string, netconf []byte, exec Exec) error {
	pluginPath, realExec, err := delegateCommon(delegatePlugin, exec)
	if err != nil {
		return err
	}
	return ExecPluginWithoutResult(ctx, pluginPath, netconf, delegateArgs("DEL"), realExec)
}