func ExecDel(plugin string, netconf []byte) error { if os.Getenv("CNI_COMMAND") != "DEL" { return fmt.Errorf("CNI_COMMAND is not DEL") } return invoke.ExecPluginWithoutResult(invoke.Find(plugin), netconf, invoke.ArgsFromEnv()) }
func ExecAdd(plugin string, netconf []byte) (*types.Result, error) { if os.Getenv("CNI_COMMAND") != "ADD" { return nil, fmt.Errorf("CNI_COMMAND is not ADD") } return invoke.ExecPluginWithResult(invoke.Find(plugin), netconf, invoke.ArgsFromEnv()) }