diff --git a/plugins/resource/Makefile b/plugins/resource/Makefile index dca4586ed..783f03f82 100644 --- a/plugins/resource/Makefile +++ b/plugins/resource/Makefile @@ -2,7 +2,7 @@ include ../../common.mk GO_ARGS ?= -a -SUBCOMMANDS = subcommands/limit subcommands/limit-defaults subcommands/reserve subcommands/reserve-defaults +SUBCOMMANDS = subcommands/limit subcommands/limit-clear subcommands/limit-defaults subcommands/reserve subcommands/reserve-clear subcommands/reserve-defaults TRIGGERS = triggers/install triggers/post-delete build-in-docker: clean docker run --rm \ diff --git a/plugins/resource/src/subcommands/limit-clear/limit-clear.go b/plugins/resource/src/subcommands/limit-clear/limit-clear.go new file mode 100644 index 000000000..b794dfc30 --- /dev/null +++ b/plugins/resource/src/subcommands/limit-clear/limit-clear.go @@ -0,0 +1,20 @@ +package main + +import ( + "flag" + "os" + + "github.com/dokku/dokku/plugins/common" + "github.com/dokku/dokku/plugins/resource" +) + +func main() { + args := flag.NewFlagSet("resource:limit-clear", flag.ExitOnError) + processType := args.String("process-type", "", "process-type: A process type to clear") + args.Parse(os.Args[2:]) + + err := resource.CommandLimitClear(args.Args(), *processType) + if err != nil { + common.LogFail(err.Error()) + } +} diff --git a/plugins/resource/src/subcommands/reserve-clear/reserve-clear.go b/plugins/resource/src/subcommands/reserve-clear/reserve-clear.go new file mode 100644 index 000000000..4f882388d --- /dev/null +++ b/plugins/resource/src/subcommands/reserve-clear/reserve-clear.go @@ -0,0 +1,20 @@ +package main + +import ( + "flag" + "os" + + "github.com/dokku/dokku/plugins/common" + "github.com/dokku/dokku/plugins/resource" +) + +func main() { + args := flag.NewFlagSet("resource:reserve-clear", flag.ExitOnError) + processType := args.String("process-type", "", "process-type: A process type to clear") + args.Parse(os.Args[2:]) + + err := resource.CommandReserveClear(args.Args(), *processType) + if err != nil { + common.LogFail(err.Error()) + } +} diff --git a/plugins/resource/subcommands.go b/plugins/resource/subcommands.go index df014668f..9ee9271f2 100644 --- a/plugins/resource/subcommands.go +++ b/plugins/resource/subcommands.go @@ -21,6 +21,11 @@ func CommandLimit(args []string, processType string, r Resource) (err error) { return setRequestType(appName, processType, r, "limit") } +// CommandLimitClear implements resource:limit-clear +func CommandLimitClear(args []string, processType string) (err error) { + return nil +} + // CommandLimitDefaults implements resource:limit-defaults func CommandLimitDefaults(args []string, processType string, r Resource) (err error) { return setRequestType("_all_", "", r, "limit") @@ -41,6 +46,11 @@ func CommandReserve(args []string, processType string, r Resource) (err error) { return setRequestType(appName, processType, r, "reserve") } +// CommandReserveClear implements resource:reserve-clear +func CommandReserveClear(args []string, processType string) (err error) { + return nil +} + // CommandReserveDefaults implements resource:reserve-defaults func CommandReserveDefaults(args []string, processType string, r Resource) (err error) { return setRequestType("_all_", "", r, "reserve")