feat: Implement resource:limit and resource:reserve
Also add the install and post-delete hooks
This commit is contained in:
14
plugins/resource/src/triggers/install/install.go
Normal file
14
plugins/resource/src/triggers/install/install.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/dokku/dokku/plugins/common"
|
||||
)
|
||||
|
||||
// runs the install step for the resource plugin
|
||||
func main() {
|
||||
if err := common.PropertySetup("resource"); err != nil {
|
||||
common.LogFail(fmt.Sprintf("Unable to install the resource plugin: %s", err.Error()))
|
||||
}
|
||||
}
|
||||
18
plugins/resource/src/triggers/post-delete/post-delete.go
Normal file
18
plugins/resource/src/triggers/post-delete/post-delete.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
|
||||
"github.com/dokku/dokku/plugins/common"
|
||||
)
|
||||
|
||||
// destroys the resource property for a given app container
|
||||
func main() {
|
||||
flag.Parse()
|
||||
appName := flag.Arg(0)
|
||||
|
||||
err := common.PropertyDestroy("resource", appName)
|
||||
if err != nil {
|
||||
common.LogFail(err.Error())
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user