mirror of
https://github.com/dokku/dokku.git
synced 2025-12-29 00:25:08 +01:00
feat: initial stub implementation for resource:*-clear commands
This commit is contained in:
@@ -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 \
|
||||
|
||||
20
plugins/resource/src/subcommands/limit-clear/limit-clear.go
Normal file
20
plugins/resource/src/subcommands/limit-clear/limit-clear.go
Normal file
@@ -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())
|
||||
}
|
||||
}
|
||||
@@ -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())
|
||||
}
|
||||
}
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user